By Matt Grossman

Eli Lilly & Co. on Thursday recorded a higher second-quarter profit compared with last year's, despite a slight decline in revenue due to lower realized prices.

Volumes slightly rose for the Indianapolis-based pharmaceutical company, but the change was more than offset by lower realized prices, it said. In the quarter, pandemic-era purchasing behavior also led to a $250 million fall in revenue due to customer stocking behavior in the first quarter, and another $250 million decline due to delays in patients' receiving new prescriptions from their physicians, Eli Lilly said.

Eli Lilly's net income was $1.41 billion, or $1.55 a share, compared with a profit of $1.33 billion, or $1.44 a share, in the same three-month period a year earlier.

On an adjusted basis, the profit was $1.89 a share, the company said. FactSet's analyst consensus had forecast adjusted earnings of $1.56 a share.

Revenue in the quarter marked a 2% year-over-year decline, falling to $5.5 billion. Analysts were expecting revenue of $5.76 billion.

Other income rose to $446.9 million, compared with other expense of $32.4 million in the second quarter of 2019, due to positive mark-to-market adjustments on the company's investments in Asian pharmaceutical companies and in two U.S. companies that had IPOs in the quarter.

Write to Matt Grossman at matt.grossman@wsj.com