Spain upset Serbia's world number one Novak Djokovic and teammate Ana Ivanovic 2-1 to win their fourth Hopman Cup in an emotional final which finished in the early hours of Sunday.
The Spanish pairing of Fernando Verdasco and Anabel Medina Garrigues were underdogs against the top-seeded glamour Serbian pairing of Djokovic and Ivanovic.
However, the Spaniards came from behind to clinch the title in the deciding mixed doubles rubber.
The Spanish pair's massive edge in doubles experience came to the fore as they won in straight sets, 6-4, 7-5, to deny Serbia their first title.
Verdasco and Medina Garrigues were particularly effective in capitalising on Ivanovic's shaky play at the net and even though Djokovic tried desperately to lift his team-mate his efforts were in vain.
Medina Garrigues ranked the win up there with her doubles wins at the French Open in 2008 and 2009.
"Winning the Roland Garros doubles was exciting also, but here I didn't expect to be in the final and then win, so I am really happy," she said.
Verdasco paid tribute to the efforts of Medina Garrigues.
"She won three singles matches and she played really good in the mixed," he said. "Today Anabel was unbelievable."
It was a third near miss for the Serbian pair in Perth, who played together at the event in 2006 and 2011.
At their first appearance, representing Serbia and Montenegro they missed the final on a countback of sets won during the week, and in 2011 they qualified for the final but were then forced out by an abdominal injury to Ivanovic.
"We were unfortunate last time, this time we were beaten by a better team," Djokovic said.
Djokovic had appeared to put Serbia on track to claim the title when he won the men's singles clash with Verdasco, 6-3, 7-5.
However, Medina Garrigues, who battled a back problem early in the tournament, then levelled the tie with a 6-4, 6-7 (3/7), 6-2 win in a marathon match that went on for two hours and 38 minutes.
World number 13 Ivanovic had been in superb form in her singles matches all week and was expected to easily account for the 50th-ranked Medina Garrigues.
Ivanovic started well when she broke serve early in the first set, but the Spaniard dug deep to break back and then took the set after securing another break in the ninth game.
An unhappy Ivanovic called for the trainer early in the second set, but put aside any discomfort to level the match, before the Spaniard steadied in the third set as Ivanovic continued to make too many unforced errors.
The 30-year-old Medina Garrigues, who collapsed to the court immediately after her singles win, said it was the best victory of her career.
Follow Emirates 24|7 on Google News.