Word that Uruguay was seeking a trade deal with China prompted exultation at El Álamo ranch, a lush expanse of grass punctuated by cactus and herds of cattle on the eastern plains of Uruguay.

Most of the cattle are destined for buyers in China, where they confront tariffs of 12 percent — more than double the rate applied to meat from Australia, the largest exporter of beef to China. Ranchers in New Zealand, the second-largest exporter, enjoy duty-free access to China.

“Bring on the trade agreement,” said Jasja Kotterman, who runs the family-owned ranch. “That would level the playing field for us.”

But the enthusiasm pervading this South American country has more recently given way to resignation that a trade deal with China is unlikely to happen anytime soon. What beckoned as a fresh opportunity for Uruguay has devolved into a cautionary tale of the pitfalls of trade policy for small nations grappling with complex geopolitical realignments.

Uruguay’s president, Luis Lacalle Pou, has staked his economic legacy on achieving a trade deal with China. “We have every intention of delivering it,” he said last July, as he announced the beginning of formal negotiations. China was open to talking about a bilateral deal with Uruguay.

But Uruguay’s aspirations provoked anger and accusation in neighboring Brazil and Argentina, as well as what was seen as economic retaliation. Along with Uruguay and Paraguay, they belong to Mercosur, an alliance forged more than three decades ago to promote regional commerce.

Brazil has in recent months shunted Uruguay to the sidelines while pursuing a broader trade deal with China on behalf of the bloc.

“We want to sit down as Mercosur and discuss with our Chinese friends the Mercosur-China agreement,” Brazil’s president, Luiz Inácio Lula da Silva, said during a January visit to Uruguay’s capital, Montevideo.

In April, Mr. Lula traveled to China, where he received red carpet treatment, including a visit with the country’s top leader, Xi Jinping.

“No one is going to prohibit Brazil from improving its relationship with China,” Mr. Lula said.

Whatever interest the Chinese government had in striking a deal with Uruguay soon yielded to its focus on Brazil, a calculation grounded in basic arithmetic: Uruguay is a country of 3.4 million people, while Brazil is South America’s largest economy and home to 214 million.

Yet despite the Brazilian president’s avowed interest in brokering a trade deal, prospects for an agreement between Mercosur and China appeared somewhere between minimal and nonexistent.

A notoriously slow-moving organization rife with internal discord, Mercosur has spent more than 20 years trying to complete negotiations on a trade deal with the European Union. And one of its members, Paraguay, has no relationship with Beijing, instead maintaining relations with Taiwan. That alone rendered all but unthinkable the possibility of a deal between Mercosur and China.

All of which raised the likelihood that Uruguay could wind up damaging its dealings with its neighbors while achieving no economic gains.

“Uruguay is being used as a leverage chip for China to negotiate with Brazil,” Ms. Kotterman, the overseer of El Álamo ranch, said as a full moon cast a silver glow over the grass.

Uruguay’s reach for a trade deal with China was about more than the final destination for its cows. Its government was seeking to redraw the terms of engagement with the rest of the globe, while separating the nation from the legacy of trade protectionism that has prevailed in South America’s largest economies.

It was expressly looking to China as a counterweight to the dominance of the United States in the hemisphere.

Trade unions opposed the prospect of a deal as a threat to higher-wage factory jobs, while politicians — some within the governing coalition — condemned the president’s alignment with China as a risk to national security.

But the greatest source of concern centered on the consequences of a potential rupture within Mercosur, which was formed in 1991.

Mercosur operates as a collective to set tariffs with the rest of the world. In seeking its own deal with China, Uruguay was breaching the group’s solidarity. It would open its markets to Chinese-made factory goods in exchange for lower tariffs on beef exported to China. Extra sales for ranches in Uruguay would come at the expense of beef producers in Brazil and Argentina.

Mercosur is widely seen as falling far short of its aims to catalyze a common market in South America. Its putative designs on fostering trade have frequently been impeded by the interests of politically powerful industries in Brazil and Argentina. The two nations have succeeded in gaining dozens of exemptions that have spared their companies from competition with others in the bloc.

Still, many regional leaders place stock in cooperation as the key to achieving prosperity and freeing the continent from its outsize dependence on mining raw materials and growing commodity crops like soy.

Mercosur’s champions say the alliance is the only way for its members to construct common energy markets, international highways and other infrastructure required to advance manufacturing.

Mercosur has also cast itself as an alternative to reliance on the United States.

“Mercosur is important, and it should be more important,” said Martin Guzmán, a former Argentine economy minister. “I don’t see a way out of the problem of stagnation of the continent if it’s not through deeper integration.”

He criticized Uruguay’s pursuit of a trade deal with China as a threat to the bloc.

“If everyone behaves that way,” he said, “there is a long-term cost.”

Uruguay’s exporters preferred to focus on the potential benefits — a greater crack at selling into China, home to 1.4 billion people.

Facundo Marquez focused on the prospect of extra sales for his company, Polanco Caviar, which raises sturgeon in cages in the River Negro in the center of Uruguay. Rising incomes in China have yielded growing appetite for caviar, but Chinese producers have been almost completely protected from foreign competition.

No industry had more to gain than beef.

Uruguay exports roughly 80 percent of its beef, netting about $3 billion per year, according to the National Meat Institute, a government agency in Montevideo. But the nation’s beef producers confront tariffs of 26 percent in the United States and more than 45 percent in the European Union, after exhausting small quotas.

That makes China the obvious focus, while prompting bitter talk that Washington has refused to negotiate a trade deal to open the United States to Uruguay’s beef exports.

“The United States talks a lot about how it values Uruguay’s democracy and human rights, but at the end of the day they turn their backs on us,” said Conrado Ferber, president of the National Meat Institute. “That’s the reason we are trading with China.”

Jorge González, who runs a slaughterhouse in a modest town, Lavalleja, is especially fond of Chinese buyers because they purchase the entire cow. European buyers are typically interested in only the prime portions that make up less than half the cow. Americans purchase a little more, turning less valuable cuts into hamburger meat. But in China, a diverse array of culinary offerings, like hot pot, generates demand for even thinly sliced portions of less valuable meat.

Mr. González, 56, purchases cattle from surrounding ranches and sends them down an assembly line where workers carve the animals into meat and put the cuts into boxes. He exports most of his production around the globe by container ship. Seventy percent goes to China.

His plant has enough capacity to slaughter about 100,000 animals per year, about twice as many as he is handling now. A trade deal with China would prompt local ranchers to produce more, he said.

Mr. González holds out hope that some sort of deal with China can yet be achieved given Uruguay’s virtues as a producer of food. The country has vast open spaces and nearly four times as many cows as people, making it a useful place to produce meat for export.

“The Chinese are looking for a guaranteed supply of food,” Mr. González said.

El Álamo ranch is one of Mr. González’s suppliers. There, Ms. Kotterman and her family are betting on another aspect of the Chinese market: growing appetite for premium beef.

Over the past five years, her ranch has made a significant investment in the production of a growing herd of Wagyu — cows originally raised in Japan that are famous for their extraordinary marbling and tenderness. El Álamo has been paying Mr. González to slaughter its Wagyu, selling the meat directly to buyers in China.

There are worse places to be a cow than the rolling hills of the 14,000-acre ranch. Gauchos set out at dawn atop regal horses, driving cows to green pastures flanked by shady groves of eucalyptus trees. On a recent morning, as a pale sun labored to penetrate the mist, a veterinarian checked to see which of the cows were pregnant.

Ms. Kotterman’s father, Raymond De Smedt, fears the politics in South America are conspiring to sabotage the economics.

In his telling, China is the future. Mercosur is the past.

“It is a dead duck,” he said, referring to the alliance. “We would have been better off without Mercosur, and everyone just doing what they want.”

Laurence Blair contributed reporting from Uruguay.