SAN FRANCISCO — Yahoo’s stock rose more than 5 percent on Wednesday after the company fired its chief executive officer following more than 2½ years of financial lethargy.

Tuesday’s ouster came as investors were convinced that Carol Bartz couldn’t steer the Internet company to a long-promised turnaround.

To fill the void, Yahoo’s board named Tim Morse, its chief financial officer, as interim CEO. Bartz, who became CEO in 2009, lured Morse away from computer chip maker Altera Corp. two years ago to help her cut costs. Yahoo said it is looking for a permanent replacement.

Yahoo Chairman Roy Bostock, also a target of shareholder frustration, informed Bartz about the move by phone, according to an email the outgoing CEO sent from her iPad that was obtained by the All Things D technology blog. The blog first reported Bartz’s ouster.

Yahoo didn’t return requests for comment.

Macquarie Securities analyst Ben Schachter said the handling of Bartz’s departure was unseemly and a sign of even more drama to come at Yahoo.

In a research note late Tuesday, Schachter predicted there will be a wide range of conjecture about Yahoo’s future, with the most likely speculation centering on Yahoo as a takeover target during a vulnerable time.

Alternately, Yahoo could make a bold move itself by trying to buy the online video site, which is already talking to suitors, or trying to sell its 43 percent stake in the Alibaba Group, one of China’s most prized Internet companies. Bartz’s tense relationship with Alibaba CEO Jack Ma had fed investor dissatisfaction about her leadership.

Youssef Squali at Jefferies & Co. said that the Internet company’s challenges, and the fact that Bartz was Yahoo’s third CEO in four years, will make it tough for the board to find an “A player” for the job.

Squali said Yahoo could be sold to a large media company like News Corp. or be bought by some sort of consortium that could feature Microsoft Corp. or AOL Inc.

Bartz, 63, led an austerity campaign that helped boost Yahoo’s earnings, but the company didn’t increase its revenue even as the Internet ad market grew at a rapid clip.

Her ouster came with 16 months left on a four-year contract. That contract entitles her to severance payments that could be two to three times her annual salary and bonus, along with stock incentives she received during her tenure.

Bartz received a $2.2 million bonus to supplement her $1 million salary last year.