(CNN) -- Hakan Yakin scored twice to give Switzerland a 2-0 win over Portugal in Basel, helping the co-hosts end Euro 2008 on a high with their first-ever finals victory.
Yakin celebrates the first of his two goals to give Switzerland their first win in a European Championship finals.
With Portugal already through to the quarterfinals as Group A winners, and the Swiss eliminated after two defeats, neither team had anything apart from pride to play for.
But the Swiss were always in control and Yakin fired through the legs of goalkeeper Ricardo, after a flicked pass from fellow-striker Eren Derdiyok, to put them ahead in the 71st minute.
Yakin added his second from the penalty spot in the 83rd minute after Fernando Meira was adjudged to have fouled Tranquillo Barnetta.
It sealed Switzerland's first win in three European Championship appearances, albeit against a Portugal team that rested eight starters including Cristiano Ronaldo and Deco.
Switzerland failed to win a match at the 1996 tournament in England and then in Portugal four years ago, gaining just one draw in each.
Until Yakin's goals, Portugal winger Nani had missed the best chance in the 53rd minute when he shot wide when one-on-one with goalkeeper Pascal Zuberbuehler, who started in place of regular Swiss goalkeeper Diego Benaglio.
The veteran Zuberbuehler, who is retiring after the tournament, then saved well five minutes later from a low 20-meter shot by winger Ricardo Quaresma.
Switzerland almost stumbled into the lead in the second half when Derdiyok's cross was bundled just past the post by defender Pepe, who nearly scored an own goal.
The home side came even closer in the 65th minute as Gokhan Inler hit the outside of the post with a rocket from 25 meters out.
Portugal, the runners-up four years ago and semifinalists in the 2006 World Cup finals, will play Austria, Germany or Poland in the last eight on Thursday.