Goldman Sachs upgraded shares of United Airlines on Wednesday to buy from neutral, saying the company's stock is set to rebound in the second half of this year.

"Given [United]'s share price decline since we initiated in November 2018, it now has one of the highest levels of upside potential to our price target in our coverage universe," Goldman Sachs analysts Catherine O'Brien and Joyce Koltisko wrote in a note to investors.

United Airlines shares rose 1.4% in trading to close at $82.96 a share.

The analysts said their forecast, which is inline with the Wall Street consensus, now "appropriately" incorporates the tougher numbers expected in "more difficult second half 2019 unit revenue" from asset sales. Goldman said United's stock is now fairly priced given risks from "the potential downside risks associated with China" and "investor concerns around its loan to Avianca."

United had agreed to a nearly $500 million loan to the Colombian airline to help create a joint venture. But Goldman said BRW Aviation, the largest Avianca shareholder, was in breach of terms of the loan, which is in default.

"Additionally, we are of the view that United is likely within 12 to 36 months of signing a new contract with improved economics with its co-brand credit card partner Chase," the analysts said.

In the same note, Goldman downgraded Spirit Airlines to neutral from buy. The firm said Spirit stock "will continue to be volatile and see downside risk" to a previously improving revenue forecast.

"In the first half of 2019, we are not forecasting this revenue momentum to materialize, and we are now less confident that these initiatives will ramp up enough in the back half of 2019," O'Brien and Koltisko said.

Spirit shares fell 1% in trading to close at $49.94 a share.

Goldman's price target for United Airlines remained unchanged at $108 a share, while the firm's target for Spirit dropped to $60 from $69.