WASHINGTON — President Trump first noticed Matthew G. Whitaker on CNN in the summer of 2017 and liked what he saw — a partisan defender who insisted there was no collusion between Russia and the Trump campaign. So that July, the White House counsel, Donald F. McGahn II, interviewed Mr. Whitaker about joining the president’s team as a legal attack dog against the special counsel, Robert S. Mueller III.
At that point, the White House passed, leaving Mr. Whitaker, 49, to continue his media tour, writing on CNN’s website that Mr. Mueller’s investigation — which he had once called “crazy” — had gone too far.
Fifteen months later, the attack dog is in charge. With little ceremony on Wednesday, Mr. Trump ousted Attorney General Jeff Sessions and put Mr. Whitaker, Mr. Sessions’s chief of staff, in charge of the Justice Department — and Mr. Mueller’s Russia investigation.
People close to Mr. Trump believe that he sent Mr. Whitaker to the department in part to limit the fallout from the Mueller investigation, one presidential adviser said.
White House aides and other people close to Mr. Trump anticipate that Mr. Whitaker will rein in any report summarizing Mr. Mueller’s investigation and will not allow the president to be subpoenaed.
Friends said that Mr. Whitaker, a former tight end for the University of Iowa Hawkeyes, has greater attributes beyond his loyalty to Mr. Trump.
“He’s been underestimated before,” said Brenna Bird, a Republican county prosecutor in Iowa. “Some people look at his football background and they think, ‘Oh, he’s just a football player.’ He was an Iowa Hawkeye — he’ll tell you that. But he built a solid legal career completely independent of that.”
Winding Down the Russia Investigation
The decision to fire Mr. Sessions and replace him with Mr. Whitaker had been in the works since September, when the president began asking friends and associates if they thought it would be a good idea, according to people familiar with the discussions.
The goal was not unlike the first time the White House considered hiring Mr. Whitaker. As attorney general, he could wind down Mr. Mueller’s inquiry like the president wanted.
Mr. McGahn, for one, was a big proponent of the idea. So was Leonard A. Leo, the executive vice president of the Federalist Society who regularly advises Mr. Trump on judges and other legal matters. Mr. Whitaker had also developed a strong rapport with John F. Kelly, the White House chief of staff. Nick Ayers, Vice President Mike Pence’s chief of staff, was a fan, too.
Judging by Mr. Trump’s public comments, the closed-door charm offensive was working. In an October interview on “Fox & Friends,” Mr. Trump said: “I can tell you Matt Whitaker’s a great guy. I mean, I know Matt Whitaker.”
(On Friday, after reports surfaced that Mr. Whitaker had called courts “the inferior branch” of government and had been on the advisory board of a company that a federal judge shut down and fined nearly $26 million for cheating customers, Mr. Trump made a bizarre comment to reporters that he was not familiar with Mr. Whitaker. “I don’t know Matt Whitaker,” Mr. Trump said as he left for first leg of a weekend trip to Paris.)
By early October, Mr. Whitaker was close to becoming acting attorney general, people familiar with the situation said, because Mr. Sessions had put out feelers to the White House that he wanted to resign. His relationship with the president had so degraded by that point that he could not make the offer to Mr. Trump in person.
But White House officials wanted to wait until after the midterm elections, when any criticism would not affect voting.
The concern was well founded. At 2:44 p.m. Wednesday, hours after the election was over, Mr. Trump posted his decision on Twitter that Mr. Whitaker would “become our new Acting Attorney General of the United States.”
“He will serve our Country well,” the president wrote.
Within minutes, Democrats criticized Mr. Whitaker’s previous comments about the Russia inquiry and demanded that he recuse himself from overseeing it. He also came under fire for serving on the advisory board of World Patent Marketing in Miami, the company that has been accused by the government of bilking millions of dollars from customers.
Mr. Whitaker’s time as executive director of the conservative Foundation for Accountability and Civic Trust, which accused many Democrats, including Hillary Clinton, of legal and ethical violations also came under scrutiny. So did his legal views, including his stated belief that Marbury v. Madison, which established judicial review, was a bad ruling.
For now, Mr. Trump is standing by Mr. Whitaker — at least as a temporary solution.
“You know, it’s a shame that no matter who I put in, they go after them,” Mr. Trump said before leaving for Paris. “It’s very sad, I have to say. But he’s ‘acting.’ I think he’ll do a very good job. And we’ll see what happens.”
From Football Field to the Courtroom
Mr. Whitaker’s roots run deep in Iowa, where he was born and attended high school not far from Des Moines. He accepted a scholarship and played tight end for the Iowa Hawkeyes, with whom he appeared in the 1991 Rose Bowl. Mr. Whitaker scored a couple of touchdowns during his football career, including a clever one on a field goal fake.
Mr. Whitaker did not break any records playing for the Hawkeyes, but in Iowa, college football is king. Playing for the Hawkeyes could open doors.
“By Big Ten standards, he was not an exceptional athlete,” said Don Patterson, an assistant coach during Mr. Whitaker’s time on the football team. “The things we liked about him were all those intangibles that have so much to do with winning. He’s a very disciplined person. Very hard-working. Very committed. Very bright, obviously.”
Mr. Whitaker, listed as 6 feet 4 inches tall and 240 pounds on the Hawkeyes’s 1992 roster, embraced his status as a former football player. He graduated from law school in 1995, and as a lawyer, he became involved in Republican politics.
When he considered whether to run for state treasurer in 2002, Mr. Whitaker called an old friend from law school, Charles Larson Jr., who had become the chairman of the Iowa Republican Party.
“I knew immediately he’d be a great candidate,” said Mr. Larson, who went on to serve as the United States ambassador to Latvia. “He’d be exactly the type of candidate we’d love to have run. He had a great profile as an attorney and former Hawkeye. There’s always appeal there.”
The son of an elementary schoolteacher and a sports scoreboard salesman, Mr. Whitaker became the Republican nominee for treasurer in 2002. He toured Iowa’s 99 counties, campaigned with Senator Charles E. Grassley and marched in a parade in Sioux City. But he finished a distant second to a longtime Democratic incumbent.
Two years later, Mr. Whitaker was appointed by President George W. Bush to serve as the United States attorney for the Southern District of Iowa. He had no experience in law enforcement, but he had the support of Mr. Grassley, who recommended him. The most important cases Mr. Whitaker cited in his questionnaire to the Senate Judiciary Committee dealt with a personal injury claim and breaches of contracts.
“Iowans knew him as a star football player, of course,” Mr. Grassley said in an interview.
‘Relentless,’ ‘Abrasive,’ but also ‘Iowa Nice’
In interviews this week with several Iowa lawyers and politicians who know Mr. Whitaker, an image emerged of a respected, competent and sharply conservative lawyer with two distinct personas: a relentless and occasionally abrasive lawyer who fought for his clients and a genial politician who personified “Iowa nice” and could make an instant connection with a stranger.
“He practices law the way he played football,” said Robert Rigg, a defense lawyer and Drake University law professor who once was involved in a case with Mr. Whitaker. “He’s very aggressive. He’s very passionate about what he believes in.”
Either way, Mr. Whitaker’s profile was suddenly much higher as a top federal prosecutor in Des Moines. He came under criticism for a case his office brought in 2007 against the first openly gay member of the Iowa Legislature, Matt McCoy, a Democrat.
Mr. Whitaker’s office indicted Mr. McCoy on an attempted extortion charge, accusing him of using his authority as a state senator to force a former partner in a home security business to pay him $2,000. The former partner was paid by the F.B.I. to act as an informant and for several months recorded his conversations with Mr. McCoy.
But the evidence was not convincing. After a five-day trial in United States District Court in Des Moines, a jury deliberated for less than two hours before returning a verdict of not guilty.
“It was a horrible case — it was made up — and it was designed to take a high-profile Democrat who was popular, openly gay and listed as one of the top 100 rising stars in the Democratic Party and smear me,” Mr. McCoy said in an interview.
Kerri Kupec, a Justice Department spokeswoman, rebutted Mr. McCoy. “The allegations of improper prosecution are ridiculous,” she said. “The Justice Department signed off on the case. The F.B.I. investigated it, and career prosecutors handled the case every step of the way.”
As a federal prosecutor, Mr. Whitaker continued to show political ambition. Matt Strawn, a former chairman of the Iowa Republican Party, said Mr. Whitaker was someone “known inside Republican circles as someone you want on your side in a fight.”
Mr. Whitaker was one of 61 candidates who applied for three spots on the Iowa Supreme Court in 2011. He arrived at his interview with his family and his minister, according to a person who was part of the vetting process, but he was eliminated early and was not one of the nine names advanced to Gov. Terry Branstad for consideration.
In 2012, Mr. Whitaker supported the presidential campaigns of Tim Pawlenty and then Rick Perry. And in 2014, he was one of several Republicans who sought his party’s nomination for a United States Senate seat. Mr. Whitaker finished fourth in the primary against Joni Ernst, who went on to win the general election.
Mr. Whitaker’s Senate campaign website outlined a platform that was conservative but well within the Republican mainstream. He described his opposition to abortion and the Affordable Care Act, and his support for gun rights, term limits and a limited role for government.
“Over the last few years, we have seen too many politicians disregard the Constitution as they voted to increase the size and scope of government,” Mr. Whitaker said on his campaign website. “I will use my legal experience gained as a federal attorney to hold them accountable.”
But on at least one issue, Mr. Whitaker bucked the party line, taking a surprising stand against the Renewable Fuel Standard, which led to an increase in ethanol production and a boon for Iowa corn farmers. In a 2014 column in The Cedar Rapids Gazette, he acknowledged that his position was considered “heresy in electoral politics in Iowa.”
“I want to do what’s right for my children and your children,” Mr. Whitaker said in that column. “Too many politicians are so worried about getting re-elected that they fear taking an unpopular position. I don’t.”
In recent days, Mr. Whitaker has also drawn criticism for his close ties to Sam Clovis, a fellow Iowan whose campaign for state treasurer he headed in 2014. Mr. Clovis, who later became an adviser to Mr. Trump’s campaign, is a witness in Mr. Mueller’s inquiry.
Mr. Trump nominated Mr. Clovis last year to a position in the Department of Agriculture, but Mr. Clovis withdrew from consideration after scrutiny of his qualifications and his connections to the Russia investigation.
Getting Noticed by Trump
By October of last year, Mr. Whitaker was telling people that he was working as a political commentator on CNN in order to get the attention of Mr. Trump, said John Q. Barrett, a professor at St. John’s University School of Law who met Mr. Whitaker during a television appearance last June.
His plan worked. Mr. Whitaker returned to the Justice Department in October 2017, having once again earned the support of Mr. Trump’s closest advisers inside the West Wing.
Colleagues described him as affable and said he quickly ingratiated himself with the staff in Mr. Sessions’s office and those elsewhere in the building. But that reputation shifted over time as some people began to view him as the eyes and ears of the White House, current and former Justice Department officials said.
During a briefing this spring on a sensitive criminal case that took place with members of Mr. Sessions’s staff, Mr. Whitaker sighed and rolled his eyes during the presentation, according to a person briefed on the episode. His behavior during the meeting quickly spread through the building and was considered by career prosecutors to be disrespectful. Some colleagues also began to regard him with caution.
“He is smart and politically astute,” said Gregory A. Brower, the former head of the F.B.I.’s congressional affairs office. “He’s certainly become well connected to the administration in a short time.”
Mr. Grassley spoke to Mr. Whitaker this week, after the president’s announcement, and Mr. Whitaker conceded that he does not know how long he will remain in charge of the Justice Department.
In truth, he told Mr. Grassley, he hasn’t “the slightest idea.”
Adam Goldman and Michael D. Shear reported from Washington, and Mitch Smith from Iowa City and Des Moines. Reporting was contributed by Nicholas Fandos, Katie Benner, Charlie Savage, Mark Landler and Michael S. Schmidt from Washington, and William K. Rashbaum and Maggie Haberman from New York.