Gareth Bale scored the most important goal of his career to win the Copa del Rey for Real Madrid, netting the decisive goal against fierce rivals Barcelona in the final at the Mestalla.

The most expensive player in the world raced from the halfway line down the left wing before poking the ball past Jose Manuel Pinto to restore Madrid's lead with five minutes remaining, after Marc Bartra had cancelled out Angel Di Maria's first-half opener.

The Welshman had produced his best performance in his third game against Barcelona but had failed to find the net, but his guile paid off as his stunning late strike gave Madrid their 19th Copa del Rey, and the first trophy under coach Carlo Ancelotti.

Bartra passed a late fitness test, allowing Barca coach Gerardo Martino to field the same team that had lost 1-0 to Atletico Madrid exactly a week earlier.

Ancelotti was forced to re-jig his team due to the continued absence of Cristiano Ronaldo, opting for Isco to complement Bale and Karim Benzema.

Isco was carded after three minutes for cutting down Neymar but responded with a quick through-ball which allowed Bale to attack down the left, the Welshman shooting across the face of goal and just wide of the far post.

Bale was in the thick of the action and had another attempt a minute later, shooting on the turn, but was denied by a deflection by Javier Mascherano.

Just a couple of minutes later Madrid took the lead through a precise counter. Isco held the ball up in midfield before squaring to Bale, who found Benzema on the left wing. The Frenchman played Di Maria in with one touch and the Argentinian surged into the box to shoot into the bottom corner, Pinto unable to prevent the shot creeping in at the post.

Barca could not mount much of a response before the break. Alves got on the end of a cross from Jordi Alba but headed straight at Casillas, while both of Xavi's attempts failed to hit the target.

A fine block by Mascherano prevented Isco from making it 2-0, the former Liverpool man sliding across to prevent the forward from making the most of Bale's cut-back.

Sergio Busquets also made a decisive intervention, cutting out a ball from Benzema heading towards Bale, who was waiting to pounce.

Bale almost provided a sensational start to the second half, bursting his way past two Barca defenders only to shoot the wrong side of the near post.

The Welshman then tried his luck from outside the area, striking the ball with the outside of his foot and just onto the top of the net.

Barca were impotent for much of the second half, unable to breach Madrid's defence, which was aided by vital interventions by forwards Di Maria and Isco. Bartra's solution was to have a go from range, but his shot was batted away by Iker Casillas.

Instead it was Madrid who caused the danger. Sergio Ramos' header was saved by Pinto then as Benzema tried to curl one in, his shot deflected wide.

Ramos thought he had been manhandled in the box, then Xabi Alonso shot over the bar.

Benzema then nearly caught Pinto out at the near post, and Bale headed home from the resulting corner, but the goal was ruled out for offside with the keeper out of position.

Barca then won a corner from which Bartra rose to power a header into the top left-hand corner and beyond Casillas, who conceded for the first time in nine Copa del Rey matches this season.

Bale tried to reply with a run down the left and a shot that Pinto quickly repelled, then Luka Modric saw his shot go just over.

Barca were rejuvenated by the goal and attacked with intent, although were unable to test Casillas.

If anyone looked more likely to score it was the Catalans but with five minutes to go, Bale won the match with his rampaging run, racing past Bartra before calmly beating Pinto.

The game almost took another twist in stoppage time, Neymar smashing the post but the ball landing safely in the hands of Casillas before any Barca players could pounce.

But that was the Catalans' last attempt, and Madrid, beaten by city rivals Atletico in last year's final at the Bernabeu, were able to enjoy a happier outcome this time around.