DALLAS — Continental and United Airlines, which failed to complete talks this spring to become a single carrier, said Thursday that they would work together in an alliance they hope will boost revenue to offset rising fuel costs.

In striking a deal with United, Continental ended alliance negotiations with American Airlines, the nation's biggest carrier, and British Airways. Under alliances, airlines typically work together to sell tickets on each other's flights, which can result in increased revenue.

Alliances are easier to put together than mergers, which can run into opposition from labor unions or regulators.

But alliances have their limits. Without antitrust immunity from regulators, airlines are barred from working together on prices and schedules. And airlines that merge can shed overlapping routes, planes and workers.

Continental said it would seek antitrust immunity from the Transportation Department to form joint ventures on trans-Atlantic flying with United and Lufthansa, and eventually on flights to Latin America and Asia.

But in the United States, the Continental-United deal will be limited to code-sharing — selling tickets on each other's flights and offering reciprocal frequent-flier and airport-lounge programs.

Continental and United said they also hope to reduce costs by working together. Airlines have reduced capacity and raised fares and fees as fuel costs surged.

Continental Airlines Inc. and UAL Corp.'s United Airlines said they will link their networks and join the Star Alliance, one of three competing teams of airlines around the world.

Continental will leave the SkyTeam alliance, which includes Delta Air Lines Inc. and the carrier Delta plans to buy, Northwest Airlines Corp.

American, a unit of AMR Corp., and British Airways tried to lure Continental to its team. But the move grew less likely as Continental resumed its flirtation with United.

"We are still talking to BA," said Tim Wagner, a spokesman for American Airlines. "This doesn't have any effect on that."

Earlier this year, Continental and United were in advanced talks to become a single carrier. But Continental walked away from the deal, after UAL reported a huge loss for the first quarter. Continental Chief Executive Lawrence Kellner said the Houston-based carrier preferred to remain independent.

Kellner said Thursday that as the industry faces "some of the most challenging conditions airlines have ever faced," linking with another carrier gives Continental a larger network with expanded global reach and new ways of cost reductions.

United CEO Glenn Tilton said Continental, which has a valuable hub in Newark, N.J., serving New York, would be a boost to the Star Alliance and improve the two carriers' U.S. network.

"This is the right time for this move," Tilton said in a message to employees. "Our industry is under tremendous pressure due to today's record-high fuel prices. We need to be creative in finding ways to increase our revenue and reduce our costs."