SYDNEY (Reuters) - Australia’s conservative coalition government regained its razor-thin parliamentary majority on Saturday after inner Sydney voters re-elected a former professional tennis player in a special poll triggered by a constitutional crisis.

Australia's Prime Minister Malcolm Turnbull attends the APEC Economic Leaders' Meeting in Danang, Vietnam November 11, 2017. REUTERS/Jorge Silva

The Liberal Party victory in the blue-ribbon Sydney seat of Bennelong is a much-needed relief for Prime Minister Malcolm Turnbull, whose leadership has been increasingly unpopular with the public over the past two years.

A loss in Bennelong would have plunged his government into a parliamentary minority, forcing it to rely on independent lawmakers to complete its agenda. A loss would also have placed Turnbull’s personal position in danger.

With around 73 percent of the two-party preferred vote counted by late Saturday, the opposition Labor Party candidate Kristina Keneally has secured a swing of about 5.6 percent against the Liberal Party’s John Alexander, according to the Australian Electoral Commission.

While a sizeable swing, that was well short of the 10 percent plus needed to install Keneally, a high-profile former premier of New South Wales, Australia’s most populous state, in federal politics, and the Labor Party conceded defeat.

The battle for Bennelong was bitterly fought. Turnbull campaigned personally for Alexander in the electorate both in the run-up to the vote and on the day of the poll.

“Thank you Bennelong, the people of Bennelong have put their faith in this man,” Turnbull told cheering supporters as he raised Alexander’s arm in a victory celebration. “Liberals have come from across the state, across the nation.”

But Keneally, who ran a robust campaign urging voters to use the by-election to punish the federal government, warned Turnbull that he should be concerned about the swing to Labor.

“The verdict is in, the message is clear, we have had enough of your lousy leadership,” she said in her concession speech.

“Malcolm Turnbull injected himself in this campaign, he owns this result.”

Turnbull’s coalition has been forced to govern in minority since October, when a citizenship crisis cost him several cabinet members and wiped out his flimsy majority. Among those forced out was Turnbull’s deputy, Barnaby Joyce, who has since won back his seat.

Turnbull, who has lagged in opinion polls all year, and his minority government were forced to accept a widespread banking inquiry after independent members in parliament flexed their new-found power.

The race tightened in recent days amid a diplomatic spat between Australia and China, sparked when Turnbull accused Beijing of improper interference in Canberra. One in five Bennelong voters has Chinese heritage, raising fears of a backlash.

Alexander was forced to re-contest his seat after becoming one of 10 lawmakers, alongside Joyce, to leave parliament in recent months as they were swept up in the citizenship crisis.

Alexander left parliament because he believed he might hold dual British citizenship, which he has since rescinded. Australia’s constitution bars foreign nationals from sitting in parliament to prevent split allegiances.