WASHINGTON — Nearly two years in office, President Trump has remade the Republican Party in his own image. Case in point is in Arizona, where Trump’s rhetoric, hard anti-immigration policies and his tweets forced Sen. Jeff Flake, R-Ariz., to announce he wouldn’t seek re-election a year ago. “There may not be a place for a Republican like me in the current Republican climate or the current Republican Party,” Flake said back then. Trump also made no bones about his dislike for the late Sen. John McCain, R-Ariz.

What happened last night? Well, the Senate seat that Flake gave up is now in Democratic hands, with NBC News declaring Kyrsten Sinema the apparent winner over Republican Martha McSally in the race to succeed Flake. The call for Sinema came after she extended her lead over McSally by more than 38,000 votes.

Sinema becomes the first Democrat to win a U.S. Senate race in Arizona since 1988.

And Arizona isn’t the only place where Trump’s beefs with other Republicans ended up costing his party. In June, the president attacked Rep. Mark Sanford, R-S.C. and endorsed his primary opponent Katie Arrington – which helped defeat Sanford. What happened last week? Democrat Joe Cunningham beat Arrington, flipping that Charleston-area congressional seat to the Democrats.

And in August, Trump endorsed Kris Kobach over incumbent GOP Gov. Jeff Colyer — and Kobach narrowly won that primary. What happened last week? Well, Democrat Laura Kelly beat Kobach, giving Dems one of their most impressive wins in a red state. (And Kobach now could become Trump’s new Homeland Security secretary; more on that below.)

To be sure, Trump’s spat with retiring Sen. Bob Corker, R-Tenn., didn’t cost the GOP; Republican Marsha Blackburn easily won that Senate race. And two of the president’s other high-profile endorsements — Ron DeSantis in Florida and Brian Kemp in Georgia — won or lead in their marquee gubernatorial races, though NBC News has yet to call the GA-GOV contest. But does anyone else think that the other Republicans in those races (Adam Putnam in Florida, Casey Cagle in Georgia) might have had an easier path in winning?

Trump made it clear that there was no place for Republicans like Jeff Flake, John McCain, Mark Sanford and even Jeff Colyer in his Republican Party. And that ended up costing the GOP races in Arizona, South Carolina and Kansas.

“So after all of Trump’s gleefulness about how he personally hounded Jeff Flake out of office, Republicans ended up losing Flake’s seat,” the Toronto Star’s Daniel Dale tweeted.

Who made the smarter bet: Democrats playing to the middle or Republicans focused on the base?

We found our answer in Arizona: We used the Arizona Senate race as the chief example in posing this question: Which party made the smarter bet — Democrats focused on the middle of the electorate, or Trump/Republicans playing to the base? Well, we have our answer in Arizona.

Sinema’s message was aimed squarely at independents and disaffected Republicans (remember when she wouldn’t say if she was a “proud Democrat”), while McSally stayed to the right during the three-way GOP primary and pretty much stayed there for the general election against Sinema.

Another way to look at it: Sinema (who focused on the middle) won the Senate race in Arizona, while fellow Dem David Garcia (who focused on a progressive message) lost by double digits in the gubernatorial contest.

The uncalled Senate races (1)

-- AZ-SEN (Sinema declared the apparent winner)

FL-SEN (Scott leads Nelson by 12,562 votes as the contest heads to a manual recount)

(MS-SEN goes to runoff)

The uncalled GOV races (1)

GA-GOV (GOPer Brian Kemp remains at 50.3 percent)

The uncalled House races (10)

CA-10 (Dem Josh Harder leads Republican Jeff Denham, 51 percent to 49 percent)

CA-39 (GOPer Young Kim leads Dem Gil Cisernos, 51 percent to 49 percent)

CA-45 (GOPer Mimi Walters leads Dem Katie Porter, 50.2 percent to 49.8 percent)

CA-48 (Dem Harley Rouda has declared victory; he leads, 52 percent to 48 percent)

-- CA-49 (Dem Mike Levin is the apparent winner)

GA-7 (GOPer Rob Woodall is ahead, 50.2 percent to 49.8 percent)

ME-2 (it appears the race is headed to ranked choice to determine the winner)

NM-2 (NBC News retracted its earlier call in favor of the Republicans; Dem Xochitl Torres Small is ahead, 51 percent to 49 percent)

NC-9 (GOPer Mark Harris is ahead, 49.4 percent to 48.8 percent)

NJ-3 (Dem Andy Kim is ahead, 49.9 percent to 48.8 percent)

UT-4 (Dem Ben McAdams is ahead, 51.2 percent to 48.8 percent)

WaPo: Nielsen might be out as Homeland Security secretary

“President Trump has told advisers he has decided to remove Homeland Security Secretary Kirstjen Nielsen, and her departure from the administration is likely to occur in the coming weeks, if not sooner, according to five current and former White House officials,” the Washington Post writes. “Trump canceled a planned trip with Nielsen this week to visit U.S. troops at the border in South Texas and told aides over the weekend that he wants her out as soon as possible, these officials said. The president has grumbled for months about what he views as Nielsen’s lackluster performance on immigration enforcement and is believed to be looking for a replacement who will implement his policy ideas with more alacrity.”

Who might replace Nielsen? Trump “could name one of the agency’s other Senate-confirmed principals, such as Kevin Mc­Aleenan, the commissioner of U.S. Customs and Border Protection, or David P. Pekoske, administrator of the Transportation Security Administration and a former vice commandant of the Coast Guard… Kris Kobach’s loss in the Kansas governor’s race has generated speculation that Trump could attempt to nominate him as a replacement for Nielsen, but Kobach, Kansas’s secretary of state, remains a polarizing figure whose hard-line views — especially on immigration — are considered by many observers to be too extreme to win Senate confirmation.”

Maryland asks judge to declare Rosenstein acting attorney general

NBC’s Pete Williams: “The state of Maryland plans to ask a federal judge on Tuesday for an order declaring that Rod Rosenstein is the acting attorney general — not Matt Whitaker, who was appointed to that position last week after the forced resignation of Jeff Sessions. If the judge does as Maryland asks, ruling that Whitaker cannot serve as attorney general, it would be a blow to President Donald Trump, who bypassed Rosenstein in favor of someone who has repeatedly criticized Robert Mueller's investigation of Russian election meddling. The Justice Department would immediately appeal any such ruling, and the case could be on a fast track to the Supreme Court.”

Roger Stone pal Jerome Corsi says Mueller is planning to indict him

“Jerome Corsi, an associate of Roger Stone, says he expects to be indicted for perjury as part of special counsel Robert Mueller's investigation of Russian election meddling,” NBC’s Anna Schecter reports. “Corsi, who has been questioned over his knowledge of WikiLeaks obtaining hacked emails from Hillary Clinton's campaign chairman, said Mueller's team delivered the news at a meeting about a week ago.”

Corsi, you might remember, played a role in the Swift Boat Veterans attack on John Kerry in the 2004 presidential election.