WASHINGTON — President Trump is considering taking executive action to bar migrants, including asylum seekers, from entering the country at the southern border, according to people familiar with the plan. The effort would be the starkest indication yet of Mr. Trump’s election-season push to play to his anti-immigrant base as his party fights to keep control of Congress.

The proposal amounts to a sweeping use of presidential power to fortify the border and impose the kind of aggressive immigration restrictions and enforcement measures that Mr. Trump has made his signature pursuit.

The plan is expected to prompt a swift challenge in federal courts.

The move would be the most drastic in a series of steps that Mr. Trump has taken or threatened to take in recent days — including preparations on Thursday to send as many as 1,000 active-duty Army troops to help secure the southern border — as he works to stop what he has called an “onslaught” of immigrants only days before the midterm elections.

As part of that effort, the president has capitalized this month on the thousands of Central American migrants trekking north through Mexico. Many in the group are women and children believed to be seeking refuge from violence and economic hardship. He said without evidence this week that criminals and “unknown Middle Easterners” were “mixed in” among the people in the migrant caravan, and has blamed its formation on Democrats, falsely charging that they support allowing immigrants to stream, unchecked, into the country.