Boeing Co. (BA)  shares flew higher after UBS said it sees 50% upside for the stock.

"We believe Boeing shares carry the best upside in the sector with much of the cash growth and margin expansion story set to be unlocked with our $31 per share [free cash flow estimate for 2020]," which is 15% ahead of consensus, analyst Myles Walton wrote in an Aug. 15 note after assuming the Swiss bank's coverage of the stock.

While short-term concerns, such as the potential for trade tariffs and 737 supplier issues, could result in pullbacks, investors should see those as "attractive buying opportunities," Walton said.

UBS set its price target for Boeing shares at $515 and issued a Buy rating on the stock.

Shares of Boeing rose 3.2% to $342.31 as trading opened Thursday on the New York Stock Exchange.

The UBS analyst noted that the primary driver for Boeing's commercial plane segment will be air traffic growth, and traffic growth is running higher than the long-term expectations of 4.8%. Sales of commercial airplanes contribute to 60% of Boeing's earnings and 70% of its cash, UBS said.

Even though the commercial plane segment is critical to earnings, investors are overlooking the upside to the aftermarket service contracts, Walton said.

Boeing expects its global services business to be a $50 billion-a-year business over a five- to 10-year time frame, Chief Executive Officer Dennis Muilenburg told TheStreet's Brian Sozzi on a July conference call with analysts and members of the media. Muilenburg also saidhe views space as a growth opportunity through Boeing's satellites and deep space/low Earth orbit products.

UBS thinks Muilenburg's estimate of $50 billion a year in service contracts is a tad ambitious, but Walton still believes the services business could be worth $35 billion to $40 billion by the mid-2020s.

Muilenburg plans to build the services business by mainly investing in units it already operates, which it calls organic, as well as by making acquisitions outside the company, which it calls inorganic.

"Where it makes sense, we'll compliment [organic investments] with inorganic investments," Muilenburg said. "We clearly see acquisitions as a bolt-on compliment to what is primarily an organic investment strategy."

More from Investing

Tencent Reports Earnings on Wednesday: 5 Important Things to Watch

Tencent Reports Earnings on Wednesday: 5 Important Things to Watch

There Isn't Any Reason to Believe That the Worst Is Over

There Isn't Any Reason to Believe That the Worst Is Over

Amgen Is Showing Independent Strength in a Bullish Sign for the Future

Amgen Is Showing Independent Strength in a Bullish Sign for the Future

American International Group Is Looking Vulnerable to Further Weakness

American International Group Is Looking Vulnerable to Further Weakness

Must-Know Levels in Nvidia Stock Ahead of Earnings

Must-Know Levels in Nvidia Stock Ahead of Earnings