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

Micron Shares Slide as Analysts Slash Estimates

Micron Shares Slide as Analysts Slash Estimates

Tesla's People Problem and the Inscrutable Musk: 2 Things That Make You Go Hmmm

Tesla's People Problem and the Inscrutable Musk: 2 Things That Make You Go Hmmm

Wells Fargo CEO's Math Skills on Trial in Latest Exchange With Warren

Wells Fargo CEO's Math Skills on Trial in Latest Exchange With Warren

The Market Offered a Little Bit of Everything This Week

The Market Offered a Little Bit of Everything This Week

Skyworks and STMicro Among Winners as Apple iPhone XS Teardowns Arrive

Skyworks and STMicro Among Winners as Apple iPhone XS Teardowns Arrive