It turns out even democratic socialist authors can rake in cash. Just ask Bernie Sanders.

The independent senator from Vermont has enjoyed a recent windfall driven by book deals. In both 2016 and 2017, Sanders and his wife, Jane, had adjusted gross income of about $1.1 million, according to tax returns his 2020 presidential campaign released last month. The couple followed it up with about $560,000 in income last year.

The totals mark a stark increase from 2015, when they made roughly $240,000.

[CNBC is looking at how top 2020 presidential candidates accumulated their wealth. Check back for more updates.]

Sanders built a devoted following during his 2016 Democratic presidential primary bid against Hillary Clinton. His income spiked along with his fame. Now, the senator ranks among the "millionaires and billionaires" he has criticized during his nearly four decades as an elected official.

The tax returns raised questions about whether Sanders' newfound wealth conflicts with his message. The senator, who wants to hike taxes on the wealthy to build up social programs such as "Medicare for All" and tuition-free public college, says his fatter wallet will not affect his plans. During a CNN town hall last month, Sanders responded to questions about his wealth by saying, "I plead guilty to have written a book which was an international best-seller."

"But I think your question should ask, well, now that you wrote a book, you made money, is that going to mean that you change your policies?" Sanders continued during the event. "Well, you're looking at somebody who not only voted against Trump's disastrous tax plan — 83 percent of the benefits going to the top 1% — but I have and will continue in this campaign to fight for progressive taxation."