The agreement to join forces and respectively reshape their businesses will also see the two firms combining their consumer health units. Novartis will acquire GSK's cancer drugs business for $16 billion and sell its vaccines division, excluding the flu unit, to GSK for $7.1 billion.
In a separate deal, Novartis has agreed to sell its animal health division to Lilly for nearly $5.4bn. The firm said the moves would help it to focus on its key businesses.
"The transactions mark a transformational moment for Novartis," Joseph Jimenez, chief executive of Novartis, said in a statement. "They also improve our financial strength, and are expected to add to our growth rates and margins immediately."
Novartis and GSK said that combining their over-the-counter (OTC) units would help boost the fortunes of both the companies. "Opportunities to build greater scale and combine high quality assets in vaccines and consumer healthcare are scarce," said Andrew Witty, chief executive, of GSK. "With this transaction, we will substantially strengthen two of our core businesses and create significant new options to increase value for shareholders."