WASHINGTON — By a ratio of more than five to one, Americans in one recent poll said the United States should participate in the Paris climate change agreement that President Trump pulled out of on Thursday. Even a majority of Republicans agreed.

But in Mr. Trump’s calculation, withdrawing from the accord will be a political winner.

The decision highlighted Mr. Trump’s broader political gamble as he seeks to build a presidency that can succeed in midterm elections next year and, ultimately, in 2020 when he is up for re-election. It is a strategy predicated not on attracting new supporters, but on cultivating the narrower conservative base that delivered him to the White House.

Not everyone in the White House agrees with this approach. But when it came to the Paris accord, Mr. Trump accepted the argument advanced by Stephen K. Bannon, his chief strategist, that he must stick to his nationalist and populist roots or jeopardize his political future. Mr. Trump is not going to win over Democrats and most independents, Mr. Bannon maintained, so the imperative is to retain the voters who pulled the lever for him last year.

This is a daring and risky strategy for a president whose job approval rating remains stuck around 40 percent in many polls. Most presidents seek to widen their support while in office, reaching out to the center — if not to the other party. Mr. Trump, however, is the first president in the history of polling to govern without the support of a majority of the public from the start of his tenure. In effect, Mr. Trump is doubling down on presiding as a minority president, betting that when the time comes, his fervent supporters will matter more, especially clustered in key Midwest states.