Tune Air, the parent company of AirAsia, will exchange 10% of AirAsia shares for 20.5% of MAS stocks with the state-owned firm Khazanah Nasional.
The two carriers said they will co-operate in areas such as purchasing planes and opening new routes.
MAS will also convert its low-cost FireFly brand to a full-service airline to avoid competition with AirAsia.
"Why do we do this? I think it will help us make a lot of money," said Tony Fernandes, the chief executive of AirAsia.
The two carriers have been competing against each other for past decade. However, their fortunes have taken completely different paths.
While Malaysian Airlines has gone through some tough times, AirAsia has grown robustly to become the biggest low-cost carrier in Asia.
Analysts say the rise of AirAsia has intensified the two carriers'  competition and rivalry.
"Malaysian airlines decided that they want to take on AirAsia directly on routes where the later flies," said Siva Govindasamy of Flight Global.
"That effectively meant price competition, which is not good for business."
Mr Govindasamy said the deal will reduce direct competition, helping both airlines to concentrate on their area of specialisation.
His views were echoed by Juliana Ramli of HwangDBS Vickers Research who added "the deal could help reposition and turn around MAS as a premier long-haul carrier."
AirAsia and its rival Malaysian Airline System (MAS) have agreed a deal to swap shares in a bid to boost growth.