WASHINGTON (Reuters) - U.S. Representative Ron DeSantis, a Republican in a close race for governor of Florida, on Monday notified House of Representatives Speaker Paul Ryan that he was resigning immediately from Congress.

In a letter to Ryan, DeSantis noted that the gubernatorial campaign would keep him out of Washington for most of the remaining House sessions before the November election. As a result, it would be "inappropriate for me to accept a (congressional) salary," DeSantis wrote.

DeSantis' term in the House would have expired in January whether he won the gubernatorial race or not.

His Democratic opponent for governor is Tallahassee Mayor Andrew Gillum, who is black. Late last month, there were reports that DeSantis made a racially-tinged remark in referring to Gillum. DeSantis has denied the remark was racially motivated.

On Monday, the Washington Post reported that DeSantis in the past has been a speaker at events organized by a conservative columnist who has said that African-Americans owe their freedom to white people and that the "only serious race war" in the United States targets whites.

Stephen Lawson, a DeSantis campaign spokesman, said the decision to resign from Congress was not related to those reports.

The Nov. 6 election between DeSantis, who has been endorsed by President Donald Trump, and Gillum is seen as too close to call. The winner will replace Republican Governor Rick Scott, who also is in a tight U.S. Senate race against incumbent Democrat Bill Nelson.

(Reporting by Richard Cowan and Susan Cornwell; Editing by Chizu Nomiyama and Paul Simao)