(Adds quotes from conference calls, updates share prices)
By Ahmed Farhatha and John Benny
Oct 26 (Reuters) - Surging prices for gasoline and diesel in the aftermath of Hurricane Harvey spiked margins to a more than two-year high, helping two big U.S. refiners record quarterly profits on Thursday that blew past Wall Street estimates.
Marathon Petroleum Corp said its refining system was relatively spared during the hurricane season, with some short, preventive shutdowns.
"We set multiple refinery production records during the quarter, including record crude throughput in the month of August," Marathon Petroleum President Donald Templin said on a conference call.
Marathon's refining and marketing gross margins rose to $14.14 per barrel from $10.67 last year. Valero Energy Corp's refining margins rose 25.5 percent, with its refineries running at 92 percent capacity in the quarter.
Industrywide margins to produce diesel fuel rose to a more than two-and-a-half year high of $26.95 a barrel, while gasoline margins RBc1-CLc1 hit a two-year high in early September, after Hurricane Harvey struck Texas.
The hurricane sapped demand for crude and created long lines for gasoline in parts of the U.S. Southeast and Midwest.
Valero's Chief Financial Officer Lane Riggs told analysts in its earnings call that its Port Arthur refinery would have "the biggest lingering effect" in the current quarter in the aftermath of the hurricane.
Marathon Petroleum shares rose 2.6 percent earlier to $57.90, their highest since August 2015, but scaled back and were now up marginally.
Valero's shares traded down 1.8 percent at $76.21.
For the quarter ended Sept. 30, Marathon earned $1.77 per share, easily topping analysts' expectations by 29 cents, while Valero's profit of $1.91 per share beat estimates of $1.83, according to Thomson Reuters I/B/E/S. (Reporting by John Benny and Ahmed Farhatha, additional reporting by Muvija M, writing by Nivedita Bhattacharjee; Editing by Bernard Orr)