By Min Zeng 

The Pimco Total Return Fund has outpaced two-thirds of rival funds in the second quarter, a win for manager Bill Gross following a year of poor performance and investor outflows.

The $229 billion fund has posted a total return of 1.96% this quarter through Tuesday, reflecting price gains and interest payments.

That compares with 1.68% for its benchmark, the Barclays U.S. Aggregate Bond Index, according to data from fund tracker Morningstar Inc.

The performance of the world's largest bond fund is an improvement from the first quarter, when Pimco Total Return lagged behind 85% of peers, according to Morningstar.

"It's been a remarkable turnabout," said Douglas Hodge, chief executive of the fund's manager Pacific Investment Management Co., in a note published on the investment firm's website Tuesday.

Early this month, Pimco co-founder Mr. Gross tweeted that his fund is "turning a big corner." Pimco, based in Newport Beach, Calif., manages $1.94 trillion as part of Germany's Allianz SE.

A prescient bet on rising U.S. government bond prices has boosted the fund's returns. Pimco Total Return raised its U.S. government-related holdings to 50% at the end of May from 41% in April, according to data from Pimco's website.

The Pimco fund is still dealing with performance issues. Even with the strong second-quarter performance, the fund lags behind 76% its peers this year, according to Morningstar.

That has become a source of irritation for Mr. Gross. Clients pulled $4.3 billion from the fund last month, marking the 13th consecutive month of investor withdrawals, a span over which total withdrawals hit $59.6 billion.

Overall, the fund maintains a solid long-term track record. Its annualized average return over the past 15 years through Tuesday was 6.86%, beating 96% of its peers.

Investors have kept a close eye on Pimco since Mohamed El-Erian, groomed by Mr. Gross as a possible successor, quit as chief executive and co-chief investment officer earlier this year. The Wall Street Journal reported in February that Messrs. Gross and El-Erian had clashed openly.

Analysts said they are waiting to see whether the firm can stem the outflows. The fund's assets hit a record of $292.9 billion in April 2013, one month before the outflows began.

"Reversing that tide won't be easy," said Jeff Tjornehoj, head of Lipper Americas Research.

Daniel B. Roe, chief investment officer at Budros, Ruhlin & Roe Inc. of Columbus, Ohio, said investors will return provided Mr. Gross "can drive solid returns from here." The firm manages $2 billion, including $175 million in Pimco funds.

Write to Min Zeng at min.zeng@wsj.com

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