By Kirsten Grind And Michael Calia 

Legendary bond investor Bill Gross has left Pacific Investment Management Co., the firm he founded in 1971, following a year of heavy outflows from his flagship bond fund and a fight with his former chief executive and heir apparent.

Pimco, a unit of German insurer Allianz SE, was getting ready to fire Mr. Gross just before he resigned, according to people familiar with the matter. The move was driven by Pimco, not by Allianz, these people said, and comes as tensions had bubbled up at the firm in recent weeks.

Mr. Gross will depart Pimco for a position at Janus Capital Group Inc., where he will manage a newly created bond fund.

The news marks a huge shift in the mutual-fund industry, where the 70-year-old Mr. Gross widely was viewed as one of the most influential bond investors of all time. He built Pimco into a $2 trillion bond powerhouse, and his $222 billion Pimco Total Return fund is the largest bond mutual fund in the world. Mr. Gross was the face of the company, often appearing on television to give his views of the bond market and other news.

But Pimco has suffered as Mr. Gross has seen investors pull more than $65 billion from his fund since May 2013 amid spotty performance.

After former Chief Executive Mohamed El-Erian abruptly left Pimco earlier this year, Mr. Gross replaced him with six deputy chief investment officers, but the move has failed to stem outflows across the whole company. Earlier this week, the Journal reported that the Securities and Exchange Commission is investigating the $3.6 billion Pimco Total Return ETF for artificially boosting returns.

Mr. Gross's behavior grew increasingly erratic in the wake of Mr. El-Erian's departure, according to people familiar with the matter. Several months ago, the Pimco executive committee issued a warning to Mr. Gross that he needed to change his behavior, the people said.

Mr. Gross's behavior didn't change, these people said, as he yelled repeatedly at members of the committee and others.

Among the incidents that bothered Pimco executives was a lengthy phone call in which Mr. Gross raised his voice repeatedly to two Wall Street Journal reporters writing an article about the turmoil within the firm, the people said. Several Pimco deputy chief investment officers told the firm they would resign if Mr. Gross didn't leave.

In recent weeks, the executive committee began making succession plans in case Mr. Gross left the firm or was forced to leave, the people said. Mr. Gross learned of those plans and approached Janus about joining that firm, according to a person familiar with the matter. More recently, Pimco executives had decided to ask Mr. Gross to leave the company.

Mr. Gross also met face to face with Jeffrey Gundlach, chief executive of investment firm DoubleLine Capital LP, to discuss joining that firm before opting to join Janus, Mr. Gundlach said in an interview.

Mr. Gross discussed a potential move to Los Angeles-based DoubleLine at several points over the past two weeks. He called Mr. Gundlach last week, and they met face-to-face the next day at the Southern California home of Mr. Gundlach, another bond-fund manager whose views on the path of interest rates is closely watched.

Mr. Gross left Mr. Gundlach a voice mail Thursday night with his decision, Mr. Gundlach said.

Pimco CEO Douglas Hodge said in a statement Friday, "While we are grateful for everything Bill contributed to building our firm and delivering value to Pimco's clients, over the course of this year it became increasingly clear that the firm's leadership and Bill have fundamental differences about how to take Pimco forward."

Mr. El-Erian won't return to Pimco, people familiar with the matter said. Deputy Chief Investment Officer Dan Ivascyn is likely to take over portfolio management at Pimco, they said, although it is unclear if he will take over Pimco Total Return Management.

Mr. Gross will manage a newly created Janus Global Unconstrained Bond Fund and related strategies at the Denver-based mutual fund firm, Janus said in a news release Friday morning. The move is an abrupt change for Mr. Gross, who will be moving to a much smaller and less prestigious firm than the one he left. Janus's CEO, Richard Weil, joined Janus from Pimco in 2010, where he had been chief operating officer.

Mr. Gross is slated to begin working at Janus effective Monday and will start managing the bond fund and strategies fund Oct. 6. He will be based in Janus's new office in Newport Beach, Calif., which is also where Pimco is located. He will join Myron Scholes and other members of the firm's team that focuses on global asset allocation.

In a statement released by Janus, Mr. Gross said, "I look forward to returning my full focus to the fixed income markets and investing, giving up many of the complexities that go with managing a large, complicated organization. I chose Janus as my next home because of my long standing relationship with and respect for CEO Dick Weil and my desire to get back to spending the bulk of my day managing client assets."

Mr. Gross later issued a separate statement. "It was not without great thought and deliberation over quite some time that I decided to begin this next chapter," he said. "But now, after having spent considerable time serving in senior management, it is a time for me to reduce executive and people management responsibilities at a larger firm and focus on the pure aspects of portfolio management at a smaller one. Janus is the right fit at the right time in my career--and my life."

In the news release about the hiring of Mr. Gross, Mr. Weil said, "His involvement provides Janus a unique opportunity to offer strategies and products that are highly complementary to those already managed by our credit-based fixed income team."

Investors sold Treasury bonds on the news of Mr. Gross leaving Pimco. The yield on the 10-year benchmark Treasury note was hovering at around 2.506% immediately before the disclosure that Mr. Gross was leaving the hundreds of billions of dollars in Treasurys and other debt he oversaw at Pimco to go to Janus.

Within a half-hour of the statement, the 10-year yield jumped to 2.546%. While a move of 0.04 percentage point may not seem like much in that period, it was perceptible enough in the $12 trillion Treasury market that several traders and strategists attributed it to the news about Mr. Gross. Bond yields move in the opposite direction of prices.

The 10-year yield was recently 2.540%.

Shares of Janus reached a 4 1/2 -year high earlier Friday and recently were up 33% to $14.77. Meanwhile, shares of Allianz, Pimco's owner, fell 6.2% in trading in Germany and dragged down the DAX index.

Morningstar said on its website that it has placed all the Pimco-rated funds under review following the resignation of Mr. Gross. The firm said the "depth of resources" at Pimco "means investors have time to reassess their options."

Katy Burne and Ulrike Dauer contributed to this article.

Write to Kirsten Grind at kirsten.grind@wsj.com and Michael Calia at michael.calia@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires