SAN FRANCISCO — Carol A. Bartz, Yahoo’s chief executive, was fired Tuesday, ending a rocky two-year tenure in which she tried to revitalize the online media company.

She went out with the same outspoken style she used while running the company. In an e-mail she sent to employees from her iPad, titled “Goodbye,” Ms. Bartz wrote: “I am very sad to tell you that I’ve just been fired over the phone by Yahoo’s chairman of the board.” Ms. Bartz was informed of the board’s decision while she was traveling to New York from Maine, according to a person familiar with the board’s action.

She also wrote, “It has been my pleasure to work with all of you and I wish you only the best going forward.”

Ms. Bartz has been under pressure from her first day in the job to turn the company around, and in recent months the pressure from major investors intensified. The company remains adrift despite management shuffles, layoffs and the shedding of underperforming services. She engineered a deal that turned over its search operations to Microsoft, but that has also failed to live up to expectations.