The 49-year-old Spaniard quit as manager of the Belgium national team following the ignominy of an early group stage exit at the Qatar 2022 FIFA World Cup.
Martinez had been in charge of the Red Devils since 2016 and led them to third place at the 2018 World Cup in Russia.
Portugal similarly parted company with Fernando Santos after they lost to Morocco in the quarterfinals of the Qatar World Cup.
Santos had been in charge of the Portuguese national team for eight years and famously led them to European championship glory in 2016 and the inaugural UEFA Nations League in 2019.
"I am very happy to represent one of the national teams with the best talent in the world," said Martinez at his unveiling on Monday.
"I am very excited to be here. From the first time I spoke with the president of the federation I knew this was a sporting project that would excite me.
"I understand there are great expectations and big objectives, but there is a great team of people at the federation and I have great excitement that together we can achieve those objectives."
The Portugal football federation’s president, Fernando Gomes, told a news conference as Martínez stood next to him: “I appreciate the enthusiasm and ambition with which he received the invitation. This is an important moment for the national team.”
Martinez famously led an unfancied Wigan Athletic to FA Cup glory in 2013 and has also taken charge of Swansea City and Everton.