High oil prices and refining margins boosted second-quarter profits for Exxon but the company missed expectations, Exxon reported Thursday before the market open.

In pre-market trading, Exxon was down more than 1.5 percent Thursday morning on the news.

The largest publicly traded oil company, Exxon reported earnings of $10.7 billion, or $2.18 per share, for the three months period ending June 30.

In the same quarter the previous year Exxon earned $7.56 billion, or $1.60 per share.

The profit is the highest for Exxon since the company hit a record of $14.8 billion in the third quarter of 2008. Still, however, the results fell below Wall Street's expectations of $2.30 per share.

Higher oil prices have also boosted profits for Exxon's competitors, including ConocoPhillips, BP and Royal Dutch Shell PLC.