BATON ROUGE, La. — David Duke seems a figure from the past, the former Klansman and white supremacist who two decades ago was almost elected Louisiana governor.

But this week when Representative Steve Scalise, the third-ranking House Republican leader, found himself trying to explain why he accepted a speaking engagement offered by a key aide to Mr. Duke in 2002, it was a reminder of the awkward dance and hard choices that Republicans in Louisiana faced in the 1990s when Mr. Duke was one of the most charismatic politicians in the state.

In his 1991 campaign for governor against Edwin W. Edwards, Mr. Duke largely avoided explicitly racial campaigning, appealed to the frustrations and resentments of white voters and won more than 60 percent of the white vote while losing in a runoff election. Two decades later, much of his campaign has merged with the political mainstream here, and rather than a bad memory from the past, Mr. Duke remains a window into some of the murkier currents in the state’s politics where Republicans have sought and eventually won Mr. Duke’s voters, while turning their back on him.

Echoing what mainstream Republicans did during the 1991 race for governor and since then, Mr. Scalise quickly distanced himself from Mr. Duke. Mr. Scalise said he only vaguely recalled his speech, had no forewarning it was a white nationalist group and would have avoided the meeting had he known.