Scotland's Richie Ramsay dug deep to preserve a two-stroke advantage going into the closing 36 holes of the Andalucia Masters at Valderrama.

But the 28-year-old from Aberdeen may well have to fight off the challenge of back-to-form Sergio Garcia if he is to land his second European Tour title.

Having started with a brilliant 65, Ramsay is now five under par after a two-birdie, three-bogey 72.

Driving into the rough cost him a shot on the 454-yard 18th, but France's Gregory Havret - runner-up to Graeme McDowell in last year's US Open - bogeyed the hole too to reach halfway on three under.

Garcia, winner of his home Castello Masters by a 12-stroke margin last Sunday, is one further back after a second successive 70 on a layout where he has been a runner-up three times.

"Going up against one of your idols on a course, this is a dream situation," Ramsay told European Tour radio.

"It was a really tough day and I hung in there. It just illustrates how good my six under round was.

"I hit so many fairways and so many greens, but couldn't get the ball to drop. But my ball-striking was good and I've got to take the positives out of it."

Ramsay bogeyed the third and sixth, the two short holes on the outward half, but birdied the eighth and 11th.

Havret had a seven on his card for the second day running. After double-bogeying the long fourth in his opening 68 he lost his drive at the 547-yard 11th.

Birdies at the next two repaired the damage and after his 71 he commented: "This course does not accept any errors. Every hole is a real challenge and you have to focus on every shot."

Garcia needs to win again to qualify for next week's world championship in Shanghai.

"I could have been a little bit more aggressive with a couple of putts coming in, but my short game is pretty good right now," he said.

Only four of the 96 players broke par over the first two days, Miguel Angel Jimenez's 70 leaving him in fourth place at one under.

Ryder Cup captain Jose Maria Olazabal made his first cut in nine starts, just squeezing through on seven over, but for England's Nick Dougherty it is now just one cut survived in his last 29.

With rounds of 84 and 80, he brought up the rear of the field.