The deal is worth around €18.6 billion and will take the form of a 50-50 joint venture controlled by both companies with equal governance rights.
It is still subject to approval from the EU antitrust authorities but is expected to close in the second half of 2023.
Christel Heydemann, CEO of Orange said: I am very happy to announce the conclusion of these negotiations today.
“This deal paves the way for the creation of a joint company that combines the forces of ORANGE and MASMOVIL into a single, stronger operator that will enable investments in 5G and fibre, benefiting customers across Spain.
“I strongly believe that the creation of this new company is of fundamental importance for the Group, the Spanish telecoms market and for our customers.
As the second and fourth largest operators in the country, it will be in a position to challenge Telefonica, the number one operator in the country.
Vodafone currently sits at number three and is exploring its own consolidation opportunities in the UK and Europe.
Earlier this year, Orange refused to comment on speculation linking with its local rival despite several reports linking the two with a deal.
MasMovil has an extensive fibre optic offering, announcing that its offering had exceeded 27 million homes in January.
The combined entity will now accelerate investment in fibre-to-the-home services and 5G in Spain.
The European Commission is yet to respond to the confirmation of the agreement, having opposed consolidation deals in the past.
But with several agreements taking place around Europe and CEOs of major operators voicing support for consolidation, it remains to be seen if its stance has now changed.
For Spain, the number of major operators now shrinks to three.
“This is a great day for Spanish consumers as well as for our stakeholders,” Meinrad Spenger, CEO of MasMovil said.
“Together with Orange, we plan to form a strong operator with a sustainable business model and the capacity to invest in world-class infrastructure, technology and talent.
“We anticipate this will drive competition, digitisation and innovation in the Spanish market.”