NEW YORK (CNNMoney.com) -- Exxon Mobil once again reported the largest quarterly profit in U.S. history Thursday, posting net income of $11.68 billion on revenue of $138 billion in the second quarter.

That profit works out to $1,485.55 a second.

That barely beat the previous corporate record of $11.66 billion, also set by Exxon in the fourth quarter of 2007.

"The fundamentals of our business remain strong," Henry Hubble, Exxon's vice president of investor relations, said on a conference call. "We continue to capture the benefit of strong industry conditions."

But Exxon (XOM, Fortune 500) profit fell short of Wall Street estimates.

Analysts predicted the company, the world's largest publicly traded oil firm, would make $12.1 billion in profit on $144.4 billion in revenue, according to Thomson Reuters.

Exxon shares fell about 3% on the New York Stock Exchange.

Excluding money set aside for a recent damage award related to the Valdez tanker spill back in 1989, Exxon made $11.97 billion in the quarter.

Pricey oil cuts both ways

Exxon was both helped and hurt by high oil prices.

As an oil producer, the company makes a lot of money when crude prices rise. Exxon made $10 billion from selling oil in the latest quarter, up nearly 70%.

But as a refiner, it must also buy crude oil to turn into gasoline. Exxon actually buys more crude than it sells.

Profits from its refining business totaled $1.6 billion in the quarter, less than half of what they were last year.

"Record crude oil and natural gas realizations were partly offset by lower refining and chemical margins, lower production volumes and higher operating costs," read a statement attributed to Rex Tillerson, Exxon's chief executive.

While oil prices in the quarter were nearly twice as high as the same time last year, gasoline prices only rose about 30%.

That's one reason why the stock of major oil companies - such as Exxon, Chevron (CVX, Fortune 500), Royal Dutch Shell (RDSA) and BP (BP) - that both produce and refine crude has been relatively flat over the last year, despite the runup in oil prices.

Meanwhile, shares of companies that mostly produce oil, like Anadarko and Apache, have soared in the last year, while shares in refiners like Valero and Sunoco have tumbled.

Where the money goes

Exxon spent $7 billion in the second quarter finding and producing more new oil, up 38% from last year. Still, oil and natural gas production from the company fell 8%. Even excluding special events such as a labor strike in Nigeria and seizure of fields in Venezuela, production slipped 3%.

The production declines shouldn't be seen as an indicator the world is running out of oil, said Fadel Gheit, a senior energy analyst at Oppenheimer.

Rather, as the price of oil rises, the amount of oil Exxon or any international oil firm is allowed to pump from many oil-rich countries decreases, said Gheit.

"We didn't expect production to be down as much as reported," he said. "But that doesn't mean [worldwide] production is down, just that Exxon's share is decreasing."

The company returned $10.1 billion to shareholders in the form of dividends and stock buybacks, 12% more than last year.

On an earnings-per-share basis, Exxon made $2.22. That was still lower than analysts had expected, but 24% higher than last year, a gain Exxon attributed to its aggressive stock buyback plan.

The big international oil companies have been criticized for plowing much of their profits back into stock buybacks and other programs to benefit shareholders, as opposed to exploring for more oil which could bring down the price of crude for everyone.

"While oil companies are earning record profits and gas prices are soaring, the largest oil companies have invested more resources in stock buybacks than U.S. production," said Congressional Democrats in a press release shortly after Exxon announced its earnings.

Other critics charge the oil companies with deliberately restricting production in an attempt to keep prices high.

The industry says it's investing as much as it can in finding new oil, but is having a hard time given the shortage of workers and equipment in the sector.

Recent efforts by countries such as Russia, Venezuela and Kazakhstan to gain greater control of their own domestic oil resources have also hampered the ability of international oil companies to increase production.

In addition to making hefty profits, Exxon also had a hefty tax bill. Worldwide, the company paid $10.5 billion in income taxes in the second quarter, $9.5 billion in sales taxes, and over $12 billion in what it called "other taxes."

Political backlash

With Americans paying nearly $4 a gallon for gas, oil company earnings have been political fodder of late.

Congressional Democrats said they are having a conference later in the day to call for an end to tax breaks for big oil firms.

Several bills have been introduced in Congress to enact a "windfall" profits tax on these earnings, or at the very least eliminate manufacturing tax exemption oil companies now enjoy. Presumptive Democratic presidential nominee Barack Obama wants to tax oil companies at a special rate every time crude goes over $80 a barrel.

Most plans would either use this newfound tax money to fund investments in renewable energy, or give it to low income Americans struggling with high energy prices.

But so far those efforts have been blocked - mainly by Republicans - who say raising taxes on oil companies will only discourage investments in finding new oil and raise the price of crude.

Defenders of oil company profits also point out that their profit margin, at around 8%, is slightly below average for S&P 500 companies, and far below the 20%-plus margins seen at companies such as Microsoft or Pfizer.