The San Ramon, California, oil giant reported earnings of $7.7 billion, or $3.85 per share, for the three months ended June 30.

That compares with $5.4 billion, or $2.70 per share, in the year-ago period.

Revenue increased 31 percent to $66.7 billion.

Analysts had expected earnings of $3.51 per share, according to FactSet.

The results at Chevron mirror similar big gains for other major oil companies.

In the second quarter, Exxon Mobil Corp.’s earnings rose 41 percent to $10.7 billion while Royal Dutch Shell’s profit nearly doubled to $8.7 billion.