In 2011, as Ron DeSantis was running for a seat in Congress, he penned a book repudiating then-President Barack Obama’s worldview by dissecting his biracial upbringing and questioning his Christianity while also excusing the Founding Fathers for ratifying slavery in the Constitution.

In the book, “Dreams from Our Founding Fathers: First Principles in the Age of Obama,” DeSantis wrote that the founders were forced to allow slavery to keep the nation together and questionably referred to the three-fifths compromise as “anti-slavery.”

DeSantis, a Republican, went on to win his congressional election and served until he resigned last month to focus on his run for governor of Florida.

The racially charged book raises fresh questions about DeSantis’ views on race after a number of controversies during his first statewide campaign.

He kicked off the general election in August by telling voters in an interview to “not monkey this up” by voting for his Democratic opponent, Andrew Gillum, an African-American and the mayor of Tallahassee. That was followed by reports in the American Ledger and Washington Post about his ties to people with extreme views.

Later, members of the Proud Boys, a violent alt-right group with ties to white-supremacist activists, showed up to support him at a campaign stop in Sarasota.

DeSantis, a Harvard-educated lawyer who served as a Navy judge advocate general until 2010, co-published the book in 2011 with a small Florida company to bolster his House campaign. He was running for an open seat on Florida’s northeastern coast after redistricting forced the incumbent Republican to run in a different district.

In the book, DeSantis chastised Thurgood Marshall, the first African-American to serve on the Supreme Court and the great-grandson of a slave, for criticizing the authors of the Constitution for not abolishing slavery.

“For someone like Marshall, this failure overshadows the numerous and long-lasting political achievements embodied in the structural foundations of the government that have nothing to do with the institution of slavery,” wrote DeSantis, adding that Marshall’s “criticism misses the mark” because, ironically, the “philosophical foundations of the Constitution are incompatible with slavery.”

According to DeSantis, the Constitution needed slavery for ratification, but the document would ultimately kill it off. (There were more than 75 years and a brutal civil war between the ratification of the Constitution and the ratification of the 13th Amendment that abolished slavery.)

DeSantis also defended the founders’ three-fifths compromise, which counted non-free people (mostly black slaves) as three-fifths of a person toward a state’s population, claiming the Constitution might have been doomed without it and that it actually “benefitted anti-slavery states.”

“Some of the notorious compromises,” he wrote, “that demonstrated a toleration of slavery, such as the ‘federal ratio,’ which allowed the slave-holding states to count 5 slaves as the equivalent of 3 free citizens (the free states did not want slaves counted at all because they did not want the political power of slave states to be enhanced), were even thought to be necessary to ensure ratification.”

DeSantis wrote that critics of the “unenlightened” Founding Fathers were guilty of “historical ignorance since counting slaves as less than a full person for purposes of representation benefitted anti-slavery states.”

In 2013, though, Paul Finkelman, a professor at Albany Law School and the author of “Slavery and the Founders: Race and Liberty in the Age of Jefferson,” wrote that the compromise was “a huge victory for slavery and gave nothing to those who favored freedom.”

In his book, DeSantis also took on a conspiratorial tone, writing that that reports of racial animus toward Obama were disproven by his popularity and that the media were “invested in an Obama victory” in 2008.

Much of the book centers on claims that Obama took his cues from radical black figures like the Rev. Jeremiah Wright, his preacher in Chicago, and Frank Marshall Davis, an activist and family friend in Hawaii, as well as radical leftists like Saul Alinsky and Bill Ayers. DeSantis also wrote that Obama’s father, despite his absence, influenced his son to adopt his “redistributive” and “anti-colonial” goals.

While DeSantis didn’t make the false claim that Obama was a Muslim, he never denounced it and questioned whether the president’s Christian faith was genuine.

“Some have claimed Obama to have been Muslim as a child, but until he joined Reverend Jeremiah Wright’s Trinity United Church in the 1980s, Obama showed little regard for any religion,” he wrote. “As we will see, not only was his political philosophy formed before he began practicing religion, but it was his political activism in Chicago that drove him to embrace the politicized Christianity practiced by (Wright).”

Referencing a passage from Obama’s autobiography “Dreams from My Father,” DeSantis wrote that Obama’s “irreligion would be an impediment to forging political relationships,” driving him to join Wright’s church out of political expediency.

This drew a sharp contrast between the faith of Obama and the faith of founders like James Madison and Alexander Hamilton.

“Whereas the community organizer Barack Obama would embrace Christianity as an outgrowth of his political activism, the political outlook of the Constitution’s creators flowed from their foundational belief in a supreme God that endowed individuals with certain basic rights,” he wrote.

He also cited a misleading anecdote that was a common right-wing talking point to show Obama’s aversion to God.

DeSantis wrote: “Obama has frequently mentioned ‘inalienable rights’ without acknowledging the role of the ‘Creator,’ including omitting the mention of the Creator when reciting the Declaration of Independence on more than one occasion, and it is clear that his political philosophy is not something that grows out of his religious faith; rather, his religious faith buttress his pre-existing collectivist vision.”

In 2012, PolitiFact determined that a political-action committee’s similar claim that Obama was the “only president in history who has deliberately removed the words ‘endowed by their Creator’” was false.” PolitiFact said that while Obama had omitted the words on occasion, Presidents Dwight Eisenhower and Ronald Reagan had as well, and noted that Obama included the words in speeches “many times.”