STORY: BP had a warning for shareholders Tuesday.

The energy giant said weak refining margins and oil trading were likely to hurt its second-quarter profit.

Investors were spooked, and shares fell over 3% after the update.

BP expects refining margins to take a hit of up to $700 million.

It also expects to record up to $2 billion in charges in the second quarter - mainly tied to a review of its Gelsenkirchen refinery in Germany.

BP said its upstream production in Q2 is expected to be broadly flat compared with the previous three months.

Analysts expect the company's net income to come in at just over $3.1 billion.

BP's update follows similar news from U.S. rival Exxon Mobil earlier this week.

It too warned lower refining margins and natural gas prices would hurt second-quarter profit.

BP is due to post its quarterly results on July 30.