GlaxoSmithKline, one of the world’s biggest drugs groups, is to be broken up after the company agreed to spin off its consumer healthcare business in a £10bn joint venture with its US rival, Pfizer.

GSK, whose consumer brands include Sensodyne and Panadol, will have a controlling stake in the partnership of 68%, with Pfizer owning the remainder.

The FTSE 100 drugs maker said that within three years of closing the deal, which is expected in the second half of 2019, it will demerge and float the consumer health business, splitting GSK into two distinct businesses: one focused on consumer, the other on pharmaceuticals and vaccines.

Investors welcomed the news, with shares in GSK closing up nearly 4% at £15.03, making it the top riser on the FTSE 100 on Wednesday.

Emma Walmsley, the chief executive of GSK, said it was a “landmark day” for the firm. “Ultimately, our goal is to create two exceptional, UK-based global companies, with appropriate capital structures, that are each well positioned to deliver improving returns to shareholders and significant benefits to patients and consumers.”

She said the deal with Pfizer was “transformational to the scale” of GSK’s consumer business. Pfizer’s consumer business includes Anadin and ChapStick, and the merger with GSK’s division will create a business generating £9.8bn in annual sales. Pfizer is probably best known as the maker of the erectile dysfunction drug Viagra, which is not included in the tie-up.

The new combined entity will be a leader in pain relief, respiratory, vitamin and mineral supplements, digestive health, skin health and therapeutic oral health. It will be a world leader in over-the-counter products, with a market share of 7.3% – ahead of its nearest competitor, Bayer, at 4.1% – and will have leading or second-place market share positions in key markets, including the US and China.

The new entity will have headquarters in Brentford, west London, with a total of about 30,000 employees. GSK expects the tie-up to generate cost savings of £500m by 2022. Walmsley said there would be “some impact” on jobs but added that the savings would not be made solely through job cuts, but in other areas, such as procurement. GSK employs a total of 98,000 people around the world.

Walmsley said that over the long-term, the deal should be positive for jobs. “I hope, once we’ve gone beyond Brexit and into a more stable environment, that we’re able to be right at the heart of the UK’s life sciences strategy but also industrial strategy, and leverage the tremendous strengths that this country has. If you take a longer-term view, I believe we should be optimistic about the opportunities both for growth and employment that this deal today will create.”

Walmsley said that GSK had a good track record of integrating businesses, citing the company’s buyout this year of the remaining $13bn stake in its consumer healthcare joint venture with Novartis.

Ian Read, chairman and chief executive of Pfizer, said the two companies had a strong track record of “creating successful collaborations”.

The deal will not include Horlicks, the malted drink popular in India that GSK is selling to Unilever.

George Salmon, an analyst at Hargreaves Lansdown, said GSK’s decision to break up the company into two businesses was a surprise after it had ignored previous calls to do so.

He said: “Under [former chief executive] Andrew Witty’s leadership, calls for GSK to spin off the consumer healthcare businesses fell on deaf ears and until now it looked like Emma Walmsley would follow suit and ignore claims that GSK’s parts are worth more than the whole.

“The separation will take away the steady cash flows of the consumer business, meaning there’s more pressure on the men and women in white coats to deliver the next generation of blockbusters.”

Walmsley said the break-up would allow GSK to accelerate its priorities in the drugs and vaccine business.

Sign up to the daily Business Today email or follow Guardian Business on Twitter at @BusinessDesk

She said the vaccines business was fast growing and provided continued cashflow, benefiting the pharma business and the longer-term nature of developing a pipeline of drugs to bring to market. GSK vaccines include the recently launched Shingrix, targeting the prevention of shingles.

Sales at GSK’s pharmaceutical and vaccines business combined are more than double its consumer healthcare sales. In 2017 the pharma business generated sales of £17.3bn, the vaccines business made £5.2bn of sales, and the consumer healthcare business, including Horlicks, made £7.8bn of sales.

Walmsley, who was chief executive of GSK consumer healthcare before taking on the top job in April 2017, will chair the new joint venture until it is separated.