Goldman Sachs Group Inc (GS) reported a 5 percent rise in quarterly profit, spurred by higher revenue from investment banking and a smaller decline in fixed-income trading than many on Wall Street had predicted.

The bank's stock rose about 2 percent to $169.86 before the bell on Tuesday.

Goldman earned $1.95 billion, or $4.10 per share, in the three months ended June 30, up from $1.86 billion, or $3.70 per share, in the same period a year earlier.

Analysts on average had expected earnings of $3.05 per share, according to Thomson Reuters I/B/E/S.

"Good client activity in investment banking and investment management as well as a better environment for our investing and lending activities helped offset less favorable conditions for institutional client services," Chief Executive Lloyd Blankfein said in a statement.

Institutional investors have been shying away from the bond market because of a lack of strong opinions about interest rates and currency moves.

Goldman's net revenue from fixed-income, currency and commodity trading, known as FICC, fell 10 percent to $2.22 billion.

Analysts had expected a bigger decline. Bernstein Research analyst Brad Hintz had estimated $1.8 billion in fixed-income trading revenue for the quarter.

Goldman's net revenue in its investing and lending division jumped 46 percent to $2.07 billion. This included net gains of $1.25 billion from investments in equities.

The bank was also helped by better results in investment banking, where it ranked No. 1 in mergers-and-acquisitions, as well as equity underwriting, for the first half of 2014, according to Thomson Reuters data.

It advised on several high-profile deals during the period, including DirecTV's (DTV) $48.5 billion sale to AT&T (T).

Investment banking revenue, which includes M&A, debt underwriting and stock underwriting, rose 15 percent to $1.78 billion.

Goldman executives often say that investment banking is the center of its broader franchise, because those clients also generate revenue for its trading, investment management and lending businesses.

The bank makes most of its money from trading and investing in capital markets. This sets it apart from JPMorgan Chase & Co (JPM), Citigroup Inc (C) and Bank of America Corp (BAC), which have big consumer lending businesses.

JPMorgan, the biggest U.S. bank by assets, on Tuesday reported an 8 percent decline in second-quarter profit as a pullback in trading of bonds and currencies by big institutions hit revenue in its securities trading business.

On Monday, Citigroup reported a 16 percent drop in trading revenue.