It's the end of an era for BlackBerry.

The Canadian company, which helped usher in the smartphone race nearly 20 years ago, on Wednesday confirmed it will no longer manufacture the iconic handheld device. Instead, it will outsource hardware development to partners. BlackBerry CEO John Chen says the company will prioritize software development, including apps and security.

"We are reaching an inflection point with our strategy," Chen said in a statement. "Our financial foundation is strong, and our pivot to software is taking hold."

BlackBerry made the revelation during its second-quarter earnings report, in which its revenue of $352 million missed Wall Street forecasts compiled by S&P Global Market Intelligence. Non-GAAP earnings per share were even for the quarter, beating analyst estimates of a loss of 5 cents a share.

Second-quarter sales of the device dipped to 400,000. In ts latest quarter, Apple sold 40.4 million iPhones.

Shares of BlackBerry closed at $8.31, which is up 5%.

The long, gradual decline of BlackBerry paralleled the rise of iPhone and Android phones. Once dominant with more than 50% of the global market, the signature device — a cell phone with a QWERTY keyboard and sophisticated software — was so addictive to millions of customers, including President Obama and Kim Kardashian West, many were referred to as CrackBerries.

The rise of iPhone, Google's Android platform and other touchscreen phones changed that and, over years, BlackBerry fell out of favor — its global share plunged to less than 1%. Even government employees, for years a loyal customer base, turned away. U.S. Senate staff members made the switch from BlackBerry, according to a memo from the Senate Sergeant at Arms this summer.

Like tech pioneers before it, BlackBerry was left behind. Its then-upstart iPhone and others took smartphones beyond email and messages, as BlackBerry had, to browsing and a multitude of apps, analysts say.

"BlackBerry failed to anticipate elemental changes in the market," says Charles King, principal analyst of Pund-IT. The company's descent took so long, he says, "there is an element of putting the poor thing out of its misery."

The company, once valued as high as $83 billion, is now worth about $4.1 billion.

It wasn't for a lack of effort that BlackBerry faded away. It attempted a comeback in 2013 with the launch of a touchscreen-only smartphone as well as its BlackBerry 10 operating software. However, poor sales pushed the company to consider a potential sale later that year. BlackBerry eventually dropped the sales bid and replaced CEO Thorsten Heins with Chen.

BlackBerry has since made multiple efforts to revive its smartphone business, including the August launch of the Android-powered DTEK50, which the company claimed was the most secure smartphone in the world. A good deal of the device's appeal was security: Chen told USA TODAY last year that BlackBerry relied on the heads of state and government in developed countries to stay loyal to the phone because of its security features.

A shift to software has been part of Chen's strategy since he took over. The move to software gives BlackBerry the chance to improve its margins and generate recurring revenue, says BGC Partners analyst Colin Gillis.

"The decision to outsource the last bit of smartphone manufacturing is just the final nail in to their hardware business," Gillis says. "It’s long been a business in decline, and their future is in software."

Follow Brett Molina on Twitter: @brettmolina23. Follow Jon Swartz: @jswartz