Edberg hit his opening drive out of bounds, double-bogeyed and then failed to get up and down from a greenside bunker on the third.
With Fernandez-Castaño bogeying the second and third, Hanson grabbed the lead with birdies at the first and fifth. He was one ahead of both the Spaniard and South African James Kingston.
Hanson had his third birdie on the long seventh and turned in 32 for the second day running
On five under he was one ahead of home pair Alejandro Cañizares and Fernandez-Castaño, who got back into a tie with three birdies in four holes but then missed a four foot par putt on the short eighth.
France's Christian Cévaër was about to set the clubhouse target - with one hole to play The European Open winner was six under for the day and two under overall.