By William Mauldin 

High-level efforts to complete a major Pacific trade agreement ended Friday without resolution amid deep differences over trade in dairy and other products.

U.S. and other officials had hoped to wrap up the final contours of the 12-nation Trans-Pacific Partnership this week. Officials in a statement said they made "significant progress" and would work further on a deal, without specifying a future meeting.

"The sad thing is, it's 98% concluded," Australia's trade minister, Andrew Robb, said as ministers prepared to leave on Friday.

U.S. and Canadian officials have quarreled in recent months about ways to use the agreement to open up Canada's highly protected dairy industry, but the public dispute this week spread to three of the other developed economies negotiating the agreement--Australia, Japan and New Zealand.

"We can see clearly that there are one or two really hard issues, and one of them is dairy," New Zealand's trade minister, Tim Groser, said at a news conference Friday.

The gap over dairy, as well as disagreements about trade in automobiles, hindered the efforts of ministers to reach an accord on other issues, such as labor rules and the level of intellectual-property protection for pharmaceuticals, a priority for Washington.

"All the focus on dairy misses the other major issues that are outstanding," said Rep. Sander Levin of Michigan, the top Democrat on the House committee that oversees trade. Mr. Levin, who attended the Hawaii gathering, conceded that dairy is still "damn important."

Some backers of free trade, led by business associations and many farm groups, worry that the protective impulse the ministers showed in Hawaii could limit the scope and impact of the agreement or continue to weigh on negotiations. In an extreme case, an impasse over dairy and other sensitive issues could drag the talks out indefinitely or sap the political will to complete them.

But so far, the leaders of the two biggest economies in the group, President Barack Obama and Japanese Prime Minister Shinzo Abe, have expressed determination to seal the deal.

Top officials have made progress on other fronts. They finished the part of the agreement that would raise environmental standards in Vietnam, Malaysia and the other countries in the bloc, a key priority for Democrats and the Obama administration, according to two people familiar with the talks. The ministers also succeeded in narrowing differences on other sensitive parts of the agreement such as intellectual property, including rules for geographically linked food names, said Michael Froman, the U.S. trade representative.

Mr. Obama is seeking to clinch the Pacific trade pact as soon as possible, despite the complications of the presidential election season, to maximize the odds of getting the deal through Congress in the remainder of his term.

Mr. Obama narrowly succeeded in winning congressional approval in June for so-called fast-track legislation, meant to expedite the closure and final vote on the deal, and many Democrats and left-leaning groups oppose the TPP in current form.

"It's good news for people and the planet that no deal was done at this final do-or-die meeting given the TPP's threats to jobs, wages, safe food, affordable medicines and more," said Lori Wallach of government watchdog group Public Citizen.

While those involved in the talks knew the dairy issue had thorny political implications in the countries involved, few expected the previously isolated issue to sour the broader TPP agreement, which the Obama administration hopes will put pressure on China to adopt U.S.-favored trading rules. Dairy accounts for a small part of the total economic output of the countries negotiating the TPP, but the industry's farmers have outsize political influence in the developed countries wrangling over the issue.

For Canada, tariffs that restrict imports are especially important to the country's supply-management program, which protects dairy farmers there. "We have a lot of anxiety," said Yves Leduc, vice president of trade for the Dairy Farmers of Canada.

But New Zealand, a founding member of the TPP talks, doesn't want to sign a trade agreement that doesn't include the ability to ship more dairy products, its biggest export.

The U.S., which is emerging as a major exporter of dairy products, wants to keep some of its own barriers at the border to protect against an influx of milk products from New Zealand and Australia that could hurt less-competitive dairy farmers in key states, according to people following the talks.

"Some of these key countries have a public position, which doesn't make much sense," said Andrew Hoggard, chairman of the Federated Farmers of New Zealand, a farm-industry group. "We would hope that the Americans will show strong leadership and stand with New Zealand and Australia in looking for a comprehensive deal for dairy."

Nearly everyone who was asked about the talks said the dairy issue was clouding the gathering and limiting progress in other sensitive areas. Still, some officials and business groups pointed to progress on other issues and said the dairy gridlock could be cleared in coming days or weeks.

Before the Hawaii talks began, several U.S. lawmakers urged Mr. Froman to work on finishing the TPP without Canada if Ottawa wasn't ready to open up some of its dairy market to U.S. producers. This week, New Zealand officials angrily rejected what they interpreted as Japan's suggestion that the country, after pushing for less restricted dairy trade, could be excluded from the talks, an official said.

Participants said moving ahead without Canada also doesn't make much sense, since its economy is deeply entwined with the U.S. through existing free-trade agreements and because trade negotiators have been relying on Canada to accept milk exports from others in the group.

"Canada has been and will continue to be a committed and constructive partner at the negotiating table," said a spokesman for Canada's trade minister.

Officials from other countries say Canada was slow to enter serious discussions about opening up dairy. Agreeing to allow more dairy imports could cost the conservative government key seats in Ontario and Quebec.

Meanwhile, New Zealand officials are annoyed that the U.S. is pressing them to sign on to rules that could boost long-term protections for biologic drugs, potentially raising the price of medicine in its health system, without helping it achieve sought-after gains in dairy exports, according to people briefed on the discussions.

Mr. Froman's team is working hard to finish a deal that would attract broad support without alienating too many U.S. lawmakers, already deeply divided over Mr. Obama's trade policy.

"This is going to be a nail-biter, and we're going to need every single vote," said Tami Overby, senior vice president for Asia at the U.S. Chamber of Commerce.

Write to William Mauldin at william.mauldin@wsj.com