NEW YORK, June 21 (Reuters) - The spreads between U.S. investment-grade corporate bond yields and U.S. Treasuries have surged to their highest in over three months, in a sign of risk aversion due to political uncertainty in France and as U.S. government bonds rallied.

Spreads indicate the premium investors demand to hold corporate bonds rather than safer government securities. The spread on the ICE BofA U.S. Corporate Index, a commonly used benchmark for high-grade debt, rose to 96 basis points this week, its highest since mid-March.

Separately, the Markit CDX North American Investment Grade Index, a basket of credit default swaps that serves as a gauge of credit risk, widened to an intra-day high of over 54 basis points on Friday, its widest since May 1.

The moves followed turmoil in French financial markets where, ahead of France's surprise parliamentary elections, investors sold government bonds because of concerns over a budget crisis in the euro zone's second-biggest economy.

Barclays strategists said in a note on Friday the selloff in U.S. corporate debt was partly due to a "flight to quality" caused by political uncertainty, with investors moving to safer U.S. Treasuries, which also rallied this month after better-than-expected inflation data.

Heavier than anticipated investment-grade corporate debt issuance also contributed to spreads widening, they said. Over $31.4 billion in deals priced this week, above forecasts of $27 billion, according to IFR data.

Treasury yields - which move inversely to prices - have declined this month, with benchmark 10-year yields down to 4.269% on Friday from 4.554% at the end of May. The rally "has led investors to demand a bit more compensation for taking on credit risk," said Blair Shwedo, head of fixed income sales and trading at U.S. Bank.

Still, credit spreads remain historically tight due to U.S. economic resilience despite high borrowing costs, and the prospect of lower interest rates going forward. This time last year, investment grade spreads stood at 135 basis points.

For Daniel Krieter, director of fixed income strategy at BMO Capital Markets, it was too early to say whether the recent selloff was a buying opportunity or a sign of spreads moving to a new trading range after strong demand earlier this year.

"We suspect we will not know the answer until after the conclusion of the French election, with spreads unlikely to materially perform until after that event risk has passed at the earliest," he said in a note on Friday. (Reporting by Davide Barbuscia and Matt Tracy; Editing by Josie Kao)