President Trump’s erratic performance in office and his deteriorating standing in the polls is posing a grave threat to his party’s Senate majority, imperiling incumbents in crucial swing states and undermining Republican prospects in one of the few states they had hoped to gain a seat, according to a new poll of registered voters by The New York Times and Siena College.

Senator Martha McSally of Arizona, a Republican, trails her Democratic opponent, Mark Kelly, by nine percentage points while Senator Thom Tillis of North Carolina is behind his Democratic rival, Cal Cunningham, by three. Both incumbents are polling below 40 percent despite having recently aired a barrage of television advertisements.

In Michigan, which Senate Republicans viewed as one of their few opportunities to go on the offensive this year, Senator Gary Peters, a first-term Democrat, is up by 10 percentage points over John James, who is one of the G.O.P.’s most prized recruits.