Sam Adams brewer Boston Beer Company has signed on to buy Dogfish Head Brewery in a merger agreement valued at approximately $300 million, the companies announced Thursday.

The deal would put Sam Adams beer and Dogfish Head's 60-, 90- and 120-Minute IPAs and sour beers all under the same company and combine two high-end craft breweries.

The transaction is expected to close towards the end of the second quarter of 2019. Boston Beer will be consolidating Dogfish Head's financial results into its quarterly report at the end of the second quarter of 2019.

The combined company will be led by Boston Beer CEO Dave Burwick. Both founders, Jim Koch of Boston Beer, and Sam Calagione of Dogfish Head, will be involved in the newly-combined company. The new company will also maintain a significant presence in Delaware, home of Dogfish Head.

Sam and Mariah Calagione, founders of Dogfish Head, will take nearly all of their merger consideration in the form of Boston Beer stock, becoming the largest shareholders in the company after Jim Koch. They will receive approximately 406,000 shares of Boston Beer stock, based on an agreed upon share price of $314.60.

Sam Calagione is set join Boston Beer's board of directors beginning in 2020.

Dogfish head shareholders will also receive $173 million in cash.

"We're also proud to announce that we intend to devote a percentage of the Boston Beer stock that we receive to establishing a foundation and funding various local charitable programs," Sam Calagione announced in the press release.

Dogfish Head is on pace to sell almost 300 thousand barrels in 2019. The company's net sales for the year are expected to be between $110 million and $120 million.

Boston Beer reported a little over $1 billion in revenue for fiscal year 2018.