The ruling centre-right coalition government of Angela Merkel was dealt a blow by voters in a critical regional election on Sunday after the centre-left opposition secured a wafer-thin victory, setting the scene for a tension-filled national election in the autumn when everything will be up for grabs.

Official results in the northern state of Lower Saxony saw the Social Democratic party (SPD) and its Green party allies with a one-seat majority in the state parliament in Hanover over Merkel's Christian Democrats (CDU) and pro-business liberal FDP, after a nail-biting evening.

For hours it seemed as if the election had either been a dead heat between the two factions or would see the government led by David McAllister of the CDU, who is half-Scottish, with a single-seat lead. According to the final results, the SPD-Greens had 69 seats to the CDU-FDP's 68. The biggest victors of the evening in terms of votes versus predictions were the FDP – which defied all forecasts that it would fail to secure the 5% necessary to get into parliament and instead won 10% of the vote – and the Greens which polled their best result in the state for years.

The outcome is a crucial one for Merkel, coming as it does just months before her CDU-FDP alliance will be put to the test in September when she will seek a third term in office at national elections.

Initial analysis suggested tactical voting was to blame for the CDU's 6.5% drop in support, as 100,000 CDU voters believing their party to be in safe waters, chose to place their votes with the FDP instead to prevent it from disappearing from the political scene altogether and leading to the end of the coalition.

The result leaves open the future of McAllister, the state prime minister, who, if the CDU failed to win in Lower Saxony due to a poor performance by the FDP, was tipped for a top job in Berlin.