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. He also approached fixed income investment management firm DoubleLine Group, sources said.

More recently, Pimco executives had decided to ask Mr. Gross to leave the company.

Pimco CEO Doug 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, sources said. Deputy Chief Investment Officer Dan Ivascyn is likely to take over portfolio management at Pimco, according to sources, 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. In recent trading, the benchmark 10-year note was 6/32 lower, yielding 2.535%, according to Tradeweb. Yields rise as prices fall.

Traders say it is a knee-jerk reaction, given that Mr. Gross is one of the most renowned bond-fund managers in the world and the news raised questions about what will happen with Pimco Total Return's large holdings of Treasurys. The fund holds 41% in U.S. government-related holdings.

"There are concerns that a large liquidation will result due to his abrupt departure," said Tom di Galoma, head of fixed income rates at ED&F Man Capital Markets.

Shares of Janus reached a 4 1/2 -year high earlier Friday and recently were up 32% to $14.67. 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."

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