Direct operating expense was $30.1 million, or $3.89 per barrel sold, in the third quarter 2012, compared to $32.3 million, or $4.27 per barrel sold, during the third quarter of 2011. Adjusting third quarter 2012 sales volumes for the finished product buy/sell activity, direct operating expense was $4.71 per barrel.
El Dorado refining margin was $19.41 per barrel sold, excluding finished product buy/sell activity, in the third quarter 2012, which is a significant improvement from $12.77 per barrel sold during the third quarter of 2011. Compared to third quarter 2011, our average crude oil price differential to WTI in El Dorado decreased because the lower operating rate reduced the amount of more expensive Gulf Coast crude purchases. This resulted in a crude supply that consisted of approximately 14% of Gulf Coast sourced crude. This change in crude supply, combined with a product slate that included a higher percentage of light products, were the primary drivers in margin improvement from third quarter 2011.
Retail segment contribution margin decreased to $11.0 million in the third quarter 2012, versus $15.6 million in the third quarter 2011. A steady increase in wholesale fuel price, which benefited our refining segment, resulted in a lower fuel margin compared to the year ago period. This decline in fuel margin was partially offset by lower operating expenses and a slight increase in merchandising margin compared to third quarter 2011. Fuel margin was 13.9 cents per gallon in third quarter 2012, compared to 18.8 cents per gallon in third quarter 2011.At the conclusion of the third quarter 2012, the retail segment operated 372 locations, versus 384 locations at the end of the third quarter 2011. Marketing Segment Marketing segment contribution margin improved to $9.7 million in the third quarter 2012, versus $6.8 million in the third quarter 2011. The improved results were supported by an increase in total sales volumes of 3.6 percent, to 16,715 barrels per day.