"Real had first refusal and they have told us that they are going to activate their buy-back clause," Sevilla president Jose Castro told media.
Spanish sports daily Marca reported that Sevilla had made a bid worth a total of 35 million euros ($41 million) including bonuses. However, Real matched that bid to beat their rivals to the signature of the 25-year-old.
Mariano, who was born in Spain but has roots in the Dominican Republic, was sold to Lyon a year ago.
But Real inserted a buy-back clause in the deal as well as guaranteeing themselves 35 percent of any future sell-on. Taking that into account, the actual fee paid by Real will be under 25 million euros.
Castro, who was speaking at a ceremony marking 11 years since Sevilla player Antonio Puerta died during a game, added: "Lyon had an agreement with Real. We negotiated a deal, and then Real had 48 hours in which to exercise their right. They decided to do so. We are still working on other alternatives."
Mariano came through the Real reserves but made just 14 top-team appearances at the Santiago Bernabeu before being sold to Lyon, for whom he scored 18 times in Ligue 1 last season to help the French side qualify for the Champions League.
But he was left out of Lyon's starting line-up last weekend and his return to Real comes with the European champions having so far failed to reinforce their attack following the departure of Cristiano Ronaldo to Juventus.