Goalkeeper Adam Nicklin was the hero as North Ferriby United came back from two goals down to beat Wrexham on penalties and win the FA Trophy.
Louis Moult and Jay Harris strikes had given the Welsh side a commanding 2-0 lead by the hour mark.
But Liam King's penalty gave United hope and substitute Ryan Kendall equalised late in normal time.
Kendall's header then made it 3-2 before Moult's stunning strike set up a shoot-out, which Ferriby won 5-4.
The penalties had gone to sudden death when Nicklin saved Steve Tomassen's penalty to cap a remarkable comeback by the East Yorkshire part-timers and secure their first FA Trophy.
North Ferriby - a community with a population of just under 4,000 - started as massive underdogs. The Conference North side were a division and 18 places below their Welsh opponents and were roared on by more than 3,000 supporters among the 14,585 Wembley crowd.
The Villagers, who lost the 1997 FA Vase final at the old Wembley, made a bright start, but Wrexham took the lead when Joe Clarke and Connor Jennings combined to set up Moult, who swept home from six yards.
North Ferriby's forays into the Wrexham half were rare, but a breakaway from Danny Clarke forced Andy Coughlin to come off his line to make a save.
Jason St Juste, who opted to miss St Kitts and Nevis's 2018 World Cup qualifier against the Turks and Caicos Islands so he could feature at Wembley, caused problems for the Wrexham defence early in the second half and Coughlin had to save at the winger's feet before Blaine Hudson cleared the danger.
Jennings should have doubled Wrexham's lead after he rounded Nicklin but his shot was cleared off the line by Danny Hone before Harris returned from touchline injury treatment to oblige on 59 minutes.
The midfielder found himself unmarked on the right flank and hit a shot from the edge of the area that beat Nicklin at the near post.
With Wrexham in control North Ferriby were awarded a penalty with 15 minutes remaining.
Coughlin was booked for upending Clarke and captain King struck his penalty high into the roof of the net to give his side a lifeline.
The goal gave Billy Heath's side confidence. With four minutes left, St Juste's cross from the left wing was met by Kendall to level the scores, and Coughlin then had to tip over Clarke's curling effort in the final moments just to keep Wrexham alive into extra time.
North Ferriby started the additional period as they had finished the 90 minutes and the impressive St Juste's deflected cross found Kendall, whose downward header beat Coughlin to give North Ferriby the lead for the first time.
Substitute Andy Bishop was denied by Hone's perfectly timed tackle before Moult rescued Wrexham with a stunning strike two minutes from the end of extra time to take the game to penalties.
Wrexham manager Kevin Wilkin told BBC Radio Wales: "I'm gutted. We had a great opportunity to put ourselves in the driving seat and to give the game away like we have, I feel we've left people down today.
"There were no issues, but then we started dropping off and getting deep again. We didn't defend crosses, we didn't get tight to people and gave them time and space. But credit to North Ferriby, they stuck to their work.
"I'm here to do a job. I've worked hard at it, had a couple of great cup runs but the league form hasn't been exactly where we need it to be. There's been a lot of changes, and we need to keep pushing that on for Wrexham."