London: Germany are on the brink of qualifying for the finals of Euro 2012 after beating Azerbaijan 3-1 in Baku to make it seven wins out of seven in Group A.

While Zlatan Ibrahimovic's hat trick in a 5-0 rout of Finland kept Sweden in the hunt for top spot in its group.

Real Madrid playmaker Mesut Oezil scored one goal and set up another as Germany beat Azerbaijan 3-1 in Baku yesterday, leaving Joachim Loew's side needing two points from its last three Group A games to guarantee a spot in next year's tournament in Poland and Ukraine.

Ibrahimovic inspired Sweden to a fifth win in six Group E matches, the AC Milan striker coming off the bench to score three times in 22 minutes to help lift his country three points behind the Netherlands.

World and European champion Spain followed up a 4-0 thrashing of the United States on Saturday with a 3-0 win against Venezuela, but fellow European heavyweight Italy was upset 2-0 by Ireland in Liege, Belgium, in another friendly.

In other Euro 2012 qualifiers, Hungary stayed three points behind Sweden thanks to a 3-0 win in San Marino, Belarus beat Luxembourg 2-0 to close to within a point of Group D leader France, and there were also wins for Bosnia-Herzegovina and the Faeroe Islands.

Germany, one of three countries with perfect records in qualifying along with Spain and the Netherlands, moved 10 points clear of second-place Belgium. Only Turkey, a point further back but with a game in hand, can stop Loew's men finishing top.

"It was important to win and to end the season with the seventh win. It was a perfect season," Germany captain Philipp Lahm said.

Oezil crashed an angled shot into the net off the post in the 30th minute to open the scoring before setting up striker Mario Gomez for the second goal 11 minutes later.

Murad Huseynov scored for Azerbaijan, which is managed by former Germany coach Berti Vogts, in the 89th, but Andre Schuerrle sealed victory for the visitors in injury time.

Ibrahimovic was a substitute after only recently recovering from an ankle injury but came on in the 25th as a replacement for the injured Ola Toivonen, with Sweden already 1-0 up through Kim Kallstrom's goal in the 12th.

After taking the captain's armband, Ibrahimovic slotted a low finish into the bottom corner in the 31st following a slide-rule pass from Kallstrom. He then stroked the ball into an empty net four minutes later after Sebastian Larsson's cutback.

The former Barcelona and Inter Milan striker clinched his hat-trick with a free header at the back post from Kallstrom's inswinging 53rd-minute free kick, before setting up Emir Bajrami for Sweden's fifth in the 82nd.

Fresh from scoring for Barcelona in a 3-1 victory over Manchester United in the Champions League final 10 days ago, strikers David Villa and Pedro Rodriguez set an understrength Spain on its way to a convincing win in Venezuela with first-half goals.

Real Madrid midfielder Xabi Alonso added the third on the stroke of halftime as Spain coach Vicente del Bosque set a record for wins at the helm of the national team, his 39th surpassing the total achieved by predecessor Luis Aragones.

In other friendlies, Norway defeated Lithuania 1-0 and Austria won 3-1 against Latvia, which ended the match with eight men after three late sending-offs.

(Agencies)