Hershey says it rejected a takeover offer from Oreo maker Mondelez that would bring some of the world's best known cookies and chocolates under one company.

The company confirmed it received a preliminary offer from Mondelez for a mix of cash and stock totaling $107 for each share of Hershey common stock. That would value the deal at roughly $22.3 billion, according to FactSet.

Following a review, Hershey said Thursday that its board determined the offer provided "no basis for further discussion." Any deal would be subject to the approval by the Hershey Trust, a controlling shareholder.

A spokeswoman for Mondelez, Valerie Moens, declined to comment on whether the company would make a new offer.

The Wall Street Journal, citing sources it did not name, had reported earlier in the day that Mondelez told Hershey it would take the chocolate maker's name and move its global headquarters to Hershey, Pennsylvania. Hershey's shares surged following the report, and closed up nearly 17 percent at $113.49.

Mondelez shares close up almost 6 percent at $45.51.

In addition to Oreos, Mondelez International Inc., based in Deerfield, Illinois, owns Cadbury chocolates, Trident gum, Nabisco cookies and Ritz crackers.

The acquisition of Hershey would give the combined company 18 percent of the global candy market and make it the industry's largest player, according to Euromonitor International. Mars Inc., which makes M&M's and Snickers, is currently No. 1 with 13.5 percent of the market.

The deal would also give Mondelez a bigger presence in its home candy market. While Mondelez controls Cadbury abroad, Hershey has the licensing rights to the brand in the U.S. Mondelez gets the majority of its revenue from overseas, while Hershey gets most its revenue from North America.

RBC Capital Markets analyst David Palmer said he did not think the deal would ultimately happen, since control of the Hershey company is part of the Hershey Trust's mission statement. But he said the offer by Mondelez could spur more aggressive cost-cutting at Hershey.

J.P. Morgan analyst Ken Goldman said that at least part of Mondelez's rationale for making the bid was probably "defensive in nature," as the company did not want to be acquired by The Kraft Heinz Co., if Kraft is interested.

While the Hershey Trust has rejected overtures in the past, Goldman noted that its members have recently found themselves in hot water. Earlier this year, the Philadelphia Inquirer reported that the state attorney general sent the trust a letter seeking the resignation of three board members and the reduction of board compensation. The letter said the compensation exceeded the trust's own rules.

An email and phone call to the Hershey Trust were not returned Thursday.

A tie-up between Mondelez and Hershey would have marked just the latest chapter in a series of deals in the packaged food industry, with companies looking for ways to improve their financial results while up against struggling sales growth in saturated markets such as the U.S.

When Heinz announced plans to buy Kraft last year, for instance, executives cited the cost savings that would be achieved by combining manufacturing and distribution networks. That deal took place just a couple years after Kraft split with Mondelez in 2012.