All 18 of Northern Ireland's MPs have been confirmed with the SDLP and UUP losing their seats at Westminster.

The final result came in Fermanagh and South Tyrone where UUP's Tom Elliott lost to Sinn Féin's Michelle Gildernew.

Former SDLP party leaders Mark Durkan, Margaret Ritchie and Alasdair McDonnell were toppled in Foyle, South Down and Belfast South.

Media playback is unsupported on your device Media caption An historic win for Sinn Féin in Foyle

In Foyle, Sinn Féin's Elisha McCallion won by 169 votes after a recount.

She is the first non-SDLP MP to win the seat since the Foyle constituency was formed in 1983.

Media playback is unsupported on your device Media caption SDLP's Mark Durkan apologises to John Hume for losing seat

Mr Durkan said the loss "hurt" and apologised to former SDLP leader John Hume, who was the constituency's MP from 1983 to 2005.

SDLP leader Colum Eastwood said it was a "very difficult night" for the party and paid tribute to the party's three former MPs.

Meanwhile, the DUP celebrated a resurgence with a 10% increase in their vote share, a return to a level of support they last enjoyed in the 2005 general election.

Image copyright Press Eye Image caption Elected DUP MPs Nigel Dodds, Emma Little-Pengelly and Gavin Robinson with party leader Arlene Foster (middle left)

The confirmed results saw the DUP win 10 seats, Sinn Féin win seven and independent candidate Lady Sylvia Hermon retain her seat in North Down.

DUP leader Arlene Foster said she was "absolutely delighted" with the result, and that it showed the voters had bought into the party's vision.

Michelle O'Neill, Sinn Féin's northern leader, ruled out the prospect of the party taking its seats at Westminster.

Image copyright Pacemaker Image caption Sinn Féin's Elisha McCallion celebrates with the party's northern leader Michelle O'Neill

The Conservatives are on course to be the largest party but may not have an overall majority, which may make Northern Ireland's 18 MPs crucial in the balance of power.

In South Down, Ms Ritchie lost to Sinn Féin's Chris Hazzard while the DUP's Emma Little-Pengelly won the seat in Belfast South from Dr McDonnell.

The UUP's Danny Kinahan lost his seat in South Antrim to the DUP's Paul Girvan.

Media playback is unsupported on your device Media caption Danny Kinahan, UUP, said he was bitterly disappointed to have lost his South Antrim seat.

Analysis: Enda McClafferty, BBC News NI political correspondent

Politics here has turned another corner.

The middle-ground parties have been wiped from Westminster and the DUP will be Northern Ireland's only voice on the green benches.

Playing the union and border poll card has paid off for the DUP and Sinn Féin.

The polarisation of politics has moved to another level.

The upshot may well be a coming together of the unionist parties while the SDLP are likely to look south to Fianna Fail to find their way back from the wilderness.

Media playback is unsupported on your device Media caption Nigel Dodds says ten DUP MPs will play a central role at Westminster

Lady Sylvia Hermon retained her seat in North Down but had her majority of over 9,000 votes cut to around 1,200 by DUP candidate Alex Easton.

The DUP's Jim Shannon, Jeffrey Donaldson, Gregory Campbell, Gavin Robinson, Ian Paisley, Nigel Dodds, David Simpson and Sammy Wilson retained their seats in Strangford, Lagan Valley, East Londonderry, Belfast East, Belfast North, Upper Bann and East Antrim.

Image copyright Press Eye Image caption It's been a disappointing night for SDLP leader Colum Eastwood (left)

Sinn Féin's Paul Maskey, Mickey Brady and Francie Molloy also retained their seats in Belfast West, Newry and Armagh and Mid-Ulster while Barry McElduff won in West Tyrone.

A total of 109 candidates stood across Northern Ireland and 1.2m people were eligible to vote.

Image caption Turnout figures have been confirmed across Northern Ireland's 18 constituencies

The general election exit poll indicated that the Conservatives will be the largest party at Westminster but may not secure an overall majority.

If this proves correct, Northern Ireland's 18 MPs may become crucial in the formation of a government.