President Donald Trump and former President Barack Obama never went head-to-head for the White House, but now they've done the next best thing. A handful of candidates they endorsed faced off in several big stakes elections on Nov. 6.

There were at least 31 contests in which Trump and Obama have endorsed competing candidates. Twenty-two went to Obama's candidates and nine went to Trump's.

Trump regularly handed out his endorsements via tweets. Nearly every tweet had the same message -- praising candidates for being strong on the Second Amendment, the border, the military, veterans and crime.

Obama, who did not jump fully into the midterm fray until early September, released his endorsements in a pair of "waves" on August 1 and October 1. His endorsements have also included several state level races, not just races for Congress and governor.

These are the positions Trump and Obama's endorsees were vying for, and who won:

Arizona Governor

WINNER (Trump): Doug Ducey (R-Incumbent) def. David Garcia (D)

Since 1986, only one Democrat has been elected governor of Arizona.

California Governor

WINNER (Obama): Gavin Newsom (D) def. John Cox (R)

Newsom has been Lt. Governor since 2011

Colorado Governor

WINNER (Obama): Jared Polis (D) def. Walker Stapleton (R)

Polis is the first openly gay man elected as governor in the United States.

Connecticut Governor

WINNER (Obama): Ned Lamont (D) def. Bob Stefanowski (R)

Lamont has tried running for office before. Most famously, he defeated U.S. Sen. Joe Lieberman in the 2006 Democratic primary. Lieberman kept his seat after running as an independent in the general election and winning.

Florida Governor

WINNER (Trump): Ron DeSantis (R) def. Andrew Gillum (D)

Gillum conceded following a recount.

Georgia Governor

WINNER (Trump): Brian Kemp (R) def. Stacey Abrams (D)

Abrams ended her campaign and announced she had run out of legal options to challenge Kemp's victory, but refused to concede. The race was marred by accusations that Kemp, who was secretary of state and Georgia's chief elections officer, made efforts to suppress the vote. Kemp denied the allegations.

Michigan Governor

WINNER (Obama): Gretchen Whitmer (D) def. Bill Schuette (R)

Trump won this state in 2016 by 10,704 votes over Hillary Clinton -- a difference of 0.2 percent.

Minnesota Governor

WINNER (Obama): Tim Walz (D) def Jeff Johnson (R)

Incumbent Mark Dayton, a Democrat, did not run for a third term.

Nevada Governor

Winner (Obama): Steve Sisolak (D) def. Adam Laxalt (R)

In an extraordinary twist, 12 members of Laxalt's family wrote an op-ed urging voters to not vote for him.

Ohio Governor

WINNER (Trump): Mike DeWine (R) vs. Richard Cordray (D)

This is the seat being vacated by Republican John Kasich due to term limits.

Wisconsin Governor

WINNER (Obama): Tony Evers (D) def. Scott Walker (R-Incumbent)

Evers, a career educator, was the Wisconsin state school superintendent. Like Michigan, Trump narrowly won this state -- a 0.7 percent advantage over Clinton.

Arizona - U.S. Senate

WINNER (Obama): Kyrsten Sinema (D) def. Martha McSally (R)

Sinema is the first Democrat elected to the Senate from Arizona since 1988.

Nevada - U.S. Senate

WINNER (Obama): Jacky Rosen (D) def. Dean Heller (R-Incumbent)

Heller reportedly called Rosen to concede early Wednesday morning.

California - U.S. House 49th District

WINNER (Obama): Mike Levin (D) def. Diane Harkey (R)

Rep. Darrell Issa was not running for re-election for the first time since he won this seat in 2002.

Florida - U.S. House 6th District

WINNER (Trump): Michael Waltz (R) def. Nancy Soderberg (D)

Illinois - U.S. House 14th District

WINNER (Obama): Lauren Underwood (D) def. Randy Hultgren (R-Incumbent)

Iowa - U.S. House 1st District

WINNER (Obama): Abby Finkenauer (D) def. Rod Blum (R-Incumbent)

Finkenauer, 29, joins New York's Alexandria Ocasio-Cortez as the youngest women to ever be elected to Congress -- although Finkenauer is a few weeks older.

Kansas - U.S. House 3rd District

WINNER (Obama): Sharice Davids (D) def. Kevin Yoder (R-Incumbent)

Davids joins New Mexico's Deb Haaland as the first two Native American women elected to Congress.

Maine - U.S. House 2nd District

WINNER (Obama): Jared Golden (D) def. Bruce Poliquin (R-Incumbent)

Maine was the first state in the nation to use the ranked choice voting system in a general election.

Michigan - U.S. House 11th District

WINNER (Obama): Haley Stevens (D) def. Lena Epstein (R)

Minnesota - U.S. House 1st District

WINNER (Trump): Jim Hagedorn (R) def. Dan Feehan (D)

Democratic incumbent Tim Walz abandoned this seat to run for governor.

Minnesota - U.S. House 2nd District

WINNER (Obama): Angie Craig (D) def. Jason Lewis (R-Incumbent)

This was a rematch from 2016, which Lewis won over Craig 47 percent to 45.2 percent.

Minnesota - U.S. House 3rd District

WINNER (Obama): Dean Phillips (D) def. Erik Paulsen (R-Incumbent)

Phillips has vowed he will be a listener and will be accessible to his constituents.

Minnesota - U.S. House 8th District

WINNER (Trump): Pete Stauber (R) def. Joe Radinovich (D)

Nevada - U.S. House 3rd District

WINNER (Obama): Susie Lee (D) def. Danny Tarkanian (R)

This was the second consecutive run for Congress for Lee. She lost the Democratic primary for the 4th District seat in 2016.

New York - U.S. House 11th District

WINNER (Obama): Max Rose (D) def. Dan Donovan (R)

While most New York City boroughs are solidly Democrat, this district -- which encompasses Staten Island and a tiny bit of Brooklyn -- has voted more conservative in recent years.

New York - U.S. House 19th District

WINNER (Obama): Antonio Delgado vs. John Faso (R-Incumbent)

Delgado, an attorney, also had a career as a rapper under the name “AD The Voice.”

Pennsylvania - U.S. House 8th District

WINNER (Obama): Matt Cartwright (D) def. John Chrin (R)

This was an unusual race because Pennsylvania in 2018 is an unusual state. The district lines have been redrawn by order of the state supreme court due to Republican gerrymandering.

Virginia - U.S. House 7th District

WINNER (Obama): Abigail Spanberger (D) def. Dave Brat (R-Incumbent)

Spanberger is the first Democrat since 1968 to win this seat.

Washington - U.S. House 5th District

WINNER (Trump): Cathy McMorris Rodgers (R-Incumbent) def. Lisa Brown (D)

McMorris Rodgers is the fourth-ranking Republican in the House, but announced she will not seek a party leadership role in the upcoming Congress.

Wisconsin - U.S. House 1st District

WINNER (Trump): Bryan Steil (R) def. Randy Bryce (D)

This is the seat being vacated by House Speaker Paul Ryan. Trump won this district over Hillary Clinton by more than 10 points in the 2016 election.

President Donald Trump and former President Barack Obama. (BRENDAN SMIALOWSKI/AFP/Getty Images