The 53-year-old made his name with Norrkoping when he guided them to the 2015 Swedish title, the team's first such success in a quarter of a century.
"It's great news," said Andersson.
Hamren, in charge of Sweden since November 2009, had announced in February his intention to step down after the Euros.
At Euro 2016, Sweden have been drawn in Group E with Belgium, Italy and the Republic of Ireland.