The Justice Department Tuesday approved Alaska Airlines' (ALK - Get Report) merger with Virgin America (VA)  and both sides declared victory.

DOJ said in a prepared statement that it would require Alaska "to significantly reduce the scope of its codeshare agreement with American (AAL) , the world's largest airline" if it wants to complete the $4 billion deal.

The goal for DOJ was to preserve the competitiveness with American that Virgin America has shown, especially since it gained valuable slots and gates in the settlement that enabled the 2013 American/US Airways merger.

Meanwhile, Alaska CEO Brad Tilden said in a prepared statement, "We couldn't be more excited about receiving DOJ clearance." Alaska noted that it was "not required to divest any assets as a condition of DOJ clearance" and that "the majority of Alaska and American codeshare flights will remain intact."

Airline experts said the settlement was a clear positive for Alaska: Repeated delays in reaching a deal had prompted speculation that more divestitures, perhaps of airport gates, would be required.

"Great deal," said aviation consultant Bob Mann. "No hard asset divestitures {and} able to compensate for modest codeshare loss because no prohibition of reciprocal full frequent flyer earn/burn."

Under the existing codeshare agreement with American, Alaska can market American flights on more than 250 routes, while American can market Alaska flights on about 80 routes.

In a filing with the Securities and Exchange Commission, Alaska said the settlement means it will lose codeshare revenue of $15 million to $20 million in 45 markets. The 45 markets represent about $60 million of annual revenue, but the carrier believes it can recapture much of the lost revenue by operating its own flights on the affected routes.

Deutsche Bank analyst Mike Linenberg estimated the after-tax result will likely be less than $10 million, or about 10 cents a share.

JPMorgan analyst Jamie Baker wrote in a report that the "DOJ price tag {was} less than feared," largely because Alaska and Virgin America have very few slots at capacity controlled airports. Slots "are the only hard, regulated assets" for which divestitures can be mandated, he noted.

Baker raised his target price for Alaska to $93.50. In late morning trading, Alaska shares were up 63 cents to $85.63.

For the DOJ, the settlement was not about limiting the prospects for Alaska, which after the merger will control just 6% of the U.S. airline capacity. Rather, DOJ said, it wants to limit the advantage to American, one of four airlines that controls 80% of capacity.

The threat posed by the merger, DOJ said, was that Virgin America's competitiveness ends.

"The codeshare agreement between Alaska and American creates an incentive for Alaska to cooperate rather than compete with American," DOJ said in a court filing.

"Virgin has served as one of American's fiercest competitors," DOJ said. "Roughly two-thirds of Virgin's network overlaps with American's network, and Virgin has aggressively competed with American on many of these overlap routes in ways that have forced American to respond with lower fares and better service.

"Unless the codeshare is substantially modified, the proposed merger would diminish the important competition Virgin has provided on these routes," the agency said.

Besides limiting code sharing, DOJ demanded the right to approve any transactions involving the slots and gates that Virgin America was awarded as part of the 2013 settlement.

"Virgin's ownership of many of these assets and aggressive competition with American is no coincidence -- consumers were promised the benefits of expanded Virgin service to counteract the anti-competitive effects threatened by the 2013 merger between American and US Airways," the agency said.

That was another merger where both sides declared victory. The Justice Department got slots at Reagan National and LaGuardia airports, the airlines got the merger they needed, labor unions were rewarded for lobbying and even some consumer advocates said they were not displeased.

In the Alaska case, the airlines started with less to give up, and the possibility remains that as Alaska grows, it can perhaps become a larger, more important national competitor.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.