Labour's Emma Lewell-Buck has won the South Shields by-election.
UKIP candidate Richard Elvin finished second ahead of Conservative candidate Karen Allen.
Nigel Farage's party secured 24% of the vote as Labour's Emma Lewell-Buck held the seat with a reduced majority of 6,505.
The result was disastrous for the Liberal Democrats, who came seventh and lost their deposit, and also bad for the Conservatives who picked up 11.5% of the vote.
The Lib Dem candidate Hugh Annand gained just 352 votes behind the BNP.
The South Shields contest was triggered by former foreign secretary David Miliband's decision to quit politics and head to the United States to lead an international charity.
The Labour winner, a married social worker, was cheered by supporters as she became the first female MP in South Shields.
From the podium, she said: "I will help get people back to work, champion our wonderful town and never give the Tory Government one moment's peace."
Afterwards UKIP candidate Richard Elvin said: "It's an absolutely fantastic result for UKIP.
"To come from nowhere to take 25% at its first attempt is absolutely stunning.
"It's a message to all three mainstream parties that UKIP is the official opposition.
"We have proved that in Labour strongholds and we have done it again in South Shields."
Counting was also underway in the North Tyneside Mayoral election.
Labour retained their seat the Sunderland City Council by-election in Houghton Ward.
Gemma Taylor gained 1,418 votes followed by Independent John Verrill Ellis on 1,124 votes, with UKIP candidate Edward Ernest Coleman-Hughes third with 302, George Edward Brown, Local Conservatives 111 and Liberal Democrat Sue Sterling on just 55.
Voters have also gone to the polls in County Durham and Northumberland.
In Northumberland all 67 seats are being contested and in Durham there will be 126 councillors elected.
South Shields result in full
Emma Lewell-Buck (Labour) - 12,493
Richard Elvin (UK Independence Party) - 5,988
Karen Allen (Conservatives) 2,857
Ahmed Khan (Independent) 1,331
Phil Brown (Independent Socialist Party) 750
Lady Dorothy Brookes (BNP) 711
Hugh Annand (Liberal Democrats) 352
Howling Laud Hope (The Official Monster Raving Loony Party) 197
Thomas Faithful Darwood (Independent) 57 votes