WASHINGTON — By pushing Prime Minister Benjamin Netanyahu of Israel into barring an official visit by the first two Muslim women in Congress, President Trump is doubling down on a strategy aimed at dividing the Democratic Party and pushing some Jewish voters into the arms of Republicans.

But people in both parties warn that over the long term, the president could further erode bipartisan support for Israel, which has long relied on the United States as its most important ally.

In the run-up to his 2020 re-election campaign, Mr. Trump has spent months attacking the two freshman Democrats, Representatives Rashida Tlaib of Michigan and Ilhan Omar of Minnesota, angering the Democratic Party as he seeks to paint Republicans as Israel’s only true friend in Washington.

He has also marched in lock step with Mr. Netanyahu, who faces legislative elections in a few weeks. Mr. Netanyahu’s hard-line settlement policies and rigid bond with ultra-Orthodox Jews have also alienated Democrats, including many American Jews, posing a threat to the bipartisanship that has been fundamental to the two countries’ relationship since Israel’s founding in 1948.