Pfizer confirmed rumors Thursday that it was in preliminary discussions to initiate a merger with Allergan, though it said the deal is not 100 percent certain.

Only a few people related to either company had said anything about the deal previously, but both companies soon announced the deal, with Allergan saying it was in "preliminary friendly discussions," while Pfizer said it would not comment on speculation about terms of a potential agreement.

News of the potential merger had an immediate effect, causing shares of Allergan to go up 8 percent, while Pfizer's stocks traded sideways, according to CNN.

The talks come as the healthcare sector has seen a recent wave of deals since early 2014, with large drugmakers buying out smaller rivals, to consolidation among makers of generic medicines and tie-ups among insurers. 

If a deal is struck between the two in 2015, it would be the biggest deal of the year, considering Allergan's market value of $113 billion as of Thursday morning, reported The New York Times. Not only would it eclipse the deal between Anheuser-Busch InBev and SABMiller in the beer industry, but data from financial companies Dealogic and EY also indicates that it could be one of the biggest takeovers of all time.

Johnson & Johnson, ranked as the largest pharmaceutical company in the world with a market value of $278 billion, would be surpassed by the merger between Allergan and Pfizer, currently worth $219 billion, if and when they create a combined company with a potential market value of about $330 billion, according to Reuters.

A leading factor driving Pfizer to pursue a takeover is tax-related. In 2014, the company had pursued a takeover of the British pharmaceutical company AstraZeneca but ultimately failed when the U.K. drugmaker's board said the offers were insufficient.

If the takeover was successful, Pfizer would have been able to move its headquarters to the U.K. from the U.S., allowing it to save $1.4 billion annually due to lower British tax rates.

Similarly, Allergan's HQ is located in Ireland, a country that is known for low corporate taxes.

Pfizer and Allergan have stayed quiet about the details of the deal, however, with a Pfizer spokesman saying it "does not comment on market rumor and speculation."