Last updated on .From the section Tennis

Spain's victory sparked wild celebrations in Madrid's Caja Magica arena

2019 Davis Cup finals Venue: Caja Magica, Madrid Dates: 18-24 November Coverage: Listen on BBC Radio 5 Live Sports Extra from Wednesday, 20 November; Live text coverage on selected matches on the BBC Sport website and app. Click here for Live Guide.

Great Britain missed out on a place in the Davis Cup final after Spain's Rafael Nadal and Feliciano Lopez edged out Jamie Murray and Neal Skupski in a heartbreaking doubles defeat.

The British pair lost 7-6 (7-3) 7-6 (10-8) in the deciding rubber.

The teams had been level at 1-1 after the singles, when Nadal beat Dan Evans, and Kyle Edmund won against Lopez.

The Spanish pair then sparked joyous scenes in Madrid as they made it 2-1 and set up a final against Canada.

"It was a very special moment for us, a very unique opportunity," said the 38-year-old Lopez, who was close to tears at the end. "We have a great opportunity to win this tournament here at home."

Britain, who were bidding to reach the final for the first time since their 2015 triumph, will take some consolation from knowing they are guaranteed a place in next year's 18-nation finals by virtue of reaching the last four.

Spain could win the Davis Cup for the first time since 2011 if they manage to overcome Canada in what is bound to be another raucous atmosphere in the 12,500-capacity indoor Caja Magica arena (15:00 GMT).

Canada beat Russia in Saturday's opening semi-final to reach the showpiece tie for the first time in their history.

With an unfit Andy Murray again left out by British captain Leon Smith, Edmund delivered for the third day running with another straight-sets win before Evans fell to world number one Nadal.

That left Britain's fate in the hands of Jamie Murray and Davis Cup debutant Skupski - a partnership that had won both of the deciding rubbers they had needed to play earlier in the week.

The pair, who are regular partners on the ATP Tour, more than matched the two Spanish left-handers throughout a tight decider, which ended in the cruellest of fashions.

Murray and Skupski were unable to take any of four set points before the Spaniards converted their second match point as the Caja Magica erupted in celebration.

Nadal immediately jumped on top of Lopez, who had been the weaker of the two players but ultimately delivered the killer blow with a punchy serve.

After the team-mates composed themselves to embrace Murray and Skupski, Nadal showed his class by marching over to the British bench to shake every hand before returning to the court and soaking up the acclaim of an adoring crowd.

Murray and Skupski, meanwhile, sat crestfallen in their seats as they wondered how they had not managed to take the second set.

"It's really, really special," said Nadal. "Thank you to Feli [Lopez] and to the crowd who were amazing as well."

Feliciano Lopez, left, and Rafael Nadal console Jamie Murray and Neal Skupski, right, after the pair lost both sets on tie-breaks

Nadal Spain's inspiration in the tie-break

With Nadal receiving little help from Lopez's returning game, the British pair only dropped five points on serve in an evenly-matched second set.

But they could not transfer that dominance into the receiving games, apart from missed break points at 2-1 and 6-5, as the Spaniards often produced accurate serves at crucial points to alleviate danger.

The tension inside the arena was illustrated perfectly by the demeanour of Andy Murray, who was fidgeting nervously and often looked barely able to watch his older brother.

A wild smash by Lopez suddenly brought up a set point for the Britons, only for the inspired Nadal to land an accurate forehand winner down the line.

The second set point - at 6-4 in the tie-break - went begging when Lopez's serve was put into the net by Murray, leaving Skupski to try to serve it out.

Nadal somehow reached a short ball with a lob which had the Brits scrambling, to the incredulity of everyone inside the Caja Magica, allowing the world number one to then put a smash between them.

Nadal's joy was shown by his high leap off the court, with the flag-waving Spanish fans leaping off their seats too.

Britain earned another set point, this time on Nadal's serve, when Murray stunned a volley at the net, Nadal saving his country again with another perfectly placed crosscourt winner.

Nadal then landed a first serve down the middle which Murray hit into the net to give Spain their first match point at 8-7, only for the 19-time Grand Slam champion to steer a backhand well wide.

Murray put a volley long for 9-8 and a second match point on Lopez's serve, leaving the home supporters bouncing and chanting 'Ole, ole, ole!', before Lopez sealed a memorable victory.

"I thought Jamie and I played a good match. Their guys served really well. We did have our chances, but they came up with big shots at the right time," Skupski said.

Nadal was Spain's inspiration, playing a starring role in their doubles victory for the second straight day

Edmund delivers again in Murray's absence

One of the major talking points in the British camp this week has been the fitness of Andy Murray, who has not played since a rusty performance in a three-set win over Dutch world number 179 Tallon Griekspoor on Wednesday.

Yet it is credit to Edmund that Murray's absence did not hamper British hopes in the tournament like it once would have done.

World number 69 Edmund followed up straight-set wins against Kazakhstan and Germany with a fairly comfortable 6-3 7-6 (7-3) victory against an undercooked Lopez, who had not played in the singles all week and struggled to cope with the Briton's groundstrokes.

Lopez, 38, who memorably won the Queen's singles title as well as the doubles alongside Andy Murray this year, was drafted into the Spanish team at late notice after original pick Pablo Carreno Busta withdrew with a leg injury.

Evans then had the opportunity - however unlikely it seemed - to beat Nadal and put Britain into the final.

The British number one acquitted himself well before his resistance eventually broke in the final game of the first set, which Nadal took 6-4.

The Spaniard broke at the first opportunity in a contrasting second set and from that point it spiralled out of control for Evans.

The Briton won just nine points as Nadal wrapped up the set in half an hour for a 6-4 6-0 win.

Analysis

Russell Fuller, BBC tennis correspondent

The British pair won more points overall, and had four set points to take the match into a deciding set, but the genius of world number one Nadal shone through.

Nadal has already won four singles and three doubles this week, and it will take some effort by Canada to deny him and Spain a first Davis Cup title for eight years.

As for Britain, they came very close to reaching a second final in five years with Andy Murray only playing one match. Edmund produced his best form of the season, and Skupski thrived on his first experience of Davis Cup.

And they will definitely be back in Madrid next November, as all four semi-finalists qualify automatically for the 2020 Finals.

Great Britain fans cheer during Kyle Edmund's match

GB fans turn out in force

Britain were backed by almost 1,000 fans at the Caja Magica after the Lawn Tennis Association sourced an additional 975 tickets to give out free to supporters.

Andy Murray announced the plan on Instagram shortly after Friday's quarter-final win over Germany and LTA chief executive Scott Lloyd said the governing body - which spent about £60,000 - had received an "overwhelming" response.

Lloyd added LTA staff had "worked through the night" to ensure fans who were successful were notified and able to collect their tickets in plenty of time.

"We had thousands of messages and emails off people wanting to come here and support. They came in from far and wide," Lloyd told BBC Sport.

Murray had also instructed the British fans to make "plenty of noise" in the 12,500-capacity indoor arena - and they did exactly that.