Before Hope Hicks, before Corey Lewandowski and before Stephen K. Bannon, there was Sam Nunberg.

“Sam!” businessman Donald Trump would yell out as he scanned the latest printouts of news stories about himself in his 26th-floor office at Trump Tower. He would usually follow with a burst of requests or ridicule for Nunberg, his brash young fixer.

Trump, eager to gain traction inside the Republican Party, leaned on Nunberg to guide him through that political jungle and the new media landscape. They argued, they exaggerated, and they schemed. They clicked.

But until this week — as Nunberg whipsawed through cable channels vowing to defy and, later, cooperate with the Justice Department’s special counsel — you probably wouldn’t have recognized him if you saw him on the street, cursing on the phone with the New York Post tucked under his arm.

You would have just passed by the Pete Best of the Trump presidency.

Best was the original, relatively inexperienced drummer for the Beatles who was dismissed by the band in 1962, achingly close to the start of its global domination. For years after, Best was tortured as he watched his former bandmates — even Ringo — become cultural icons.

Nunberg, 36, understands that pain. In the early years of this decade, working under his mentor Roger Stone and with Trump attorney Michael Cohen, Nunberg functioned as the fledgling media strategist for a campaign-in-waiting that almost no one, including Trump, really believed would ever launch.

He toiled at Trump’s side for parts of four years, a relentless adviser for a reality TV star who wanted to spend little to nothing on staff as he teased a White House bid. And right as Trump’s campaign finally took off in the hot summer of 2015, Nunberg was fired.

News reports revealed that Nunberg had posted offensive and racist comments on Facebook. Lewandowski, by then Trump’s campaign manager, called him a “low level” aide in a statement announcing the termination.

Nunberg was furious. For the next year, he watched as Trump engulfed the GOP field, running on gut instinct and bluster but also on the playbook that he and Stone had worked on with Trump for years — build the wall, threaten a trade war, all of it.

Nunberg was soon all but forgotten. On rough days, he called up reporters to vent about Lewandowski and Hicks, Trump’s campaign spokeswoman, whom he also blamed for the “low level” knock during his exit.

On a good day, he might get a call from a reporter who needed a quote from a “former Trump adviser” to fill out a story, or he might snag a part-time paid project. Hicks and Lewandow­ski, and then Bannon and Jared Kushner and Kellyanne Conway, became the advisers turned stars who were linked in the public imagination with Trump’s winding and unconventional victory.

It wasn’t always like that, however, as special counsel Robert S. Mueller III’s team has evidently discovered.

Nunberg — who on Monday initially balked at complying with a subpoena to appear in front of a federal grand jury investigating Russia’s interference in the 2016 presidential election — remains a figure caught in the footnotes of the past, but also someone who knows a lot about what it was like in Trump’s inner sanctum when the campaign was hatched.

From when Nunberg first jumped into Trump’s orbit in 2011, Trump’s fickleness often seemed to define the job, Nunberg has confided to associates over the years. There were periods when Trump would get an adrenaline shot of media attention and would talk at length with Nunberg and Stone about running. But then there were idle stretches when Trump seemed inclined to never bring up the subject again, Nunberg said.

In the wake of Mitt Romney’s 2012 presidential defeat, Nunberg began to sketch out memos about the contours of a 2016 Trump presidential campaign. At first, it was almost a lark and a way to keep the gig. The more Trump flirted with a White House bid, the more work for him and Stone, Nunberg said in conversations over the years.

As Nunberg, who has a degree from the Touro College Law Center on Long Island, rifled through classic campaign books and scribbled a list of ideas he “stole from them,” as he has put it, the notion eventually faded as a lark and became something he saw as remote but possible. While always unsure of exactly what Trump would do, Nunberg became convinced that a candidate who could blend Ross Perot’s billionaire populism with a hard-line stance on undocumented immigrants could capture the Republican presidential nomination.

Eventually, Nunberg asked this reporter to talk with Trump and hear him out. When Trump called in July 2013, it was the expected tough talk from the host of NBC’s “The Apprentice” mixed with sharply right-wing positioning — stances right out of the memos by Stone and Nunberg.

Nunberg, who routinely went too far to find ways to impress the boss, fell out of favor with Trump after a 2014 BuzzFeed profile that Nunberg arranged became an embarrassment. It portrayed Trump as an unserious person who would never run, and Nunberg resigned in the aftermath.

Days later, Nunberg traveled alone to the Conservative Political Action Conference at National Harbor in Maryland, where Trump spoke to a packed crowd of GOP activists. Sitting at a bustling hotel bar nearby, Nunberg said in an interview then that he hoped Trump would give him another shot.

“I’m in touch with his people,” Nunberg said. “You know, I actually helped Mr. Trump get this nice afternoon speaking slot, before I left.”

Months later, as Trump began to take concrete steps toward a campaign in early 2015, Nunberg was back at Trump Tower. Trump still hated the BuzzFeed story and ragged Nunberg about it whenever he wanted to put him in his place, Nunberg said. But Nunberg was one of Stone’s guys and a Trump guy — a bomb-thrower who worshiped the combative legacy of Trump’s late mentor, Roy Cohn. Of course he was back.

But the second tour was brief.

Ever since his messy departure in the summer of 2015, Nunberg’s life has taken various turns, not all of them welcome. Trump sued him for $10 million in 2016 for allegedly violating his confidentiality agreement, although they eventually settled. The campaign viewed him as a threat and blamed him for scores of single-source stories it found troubling.

As for Trump, Nunberg wished him well with a letter at the outset of his presidency. Nunberg has also worked closely with several Trump allies, such as Newsmax chief executive Christopher Ruddy, as a media operative. But there have been no White House job offers for him.

Making the rounds on TV on Monday, Nunberg snapped back into the headlines with freewheeling interviews in which he lashed out at the Russia probe, pledged to stand by Stone, and made demeaning remarks about women, the president and Mueller. By Tuesday, he had retreated, saying he would in fact cooperate with the investigation.

Amid the firestorm, the Nunberg comments that stuck out were those about pain — the pain of a man cut from Trump’s band on the cusp of history and still dealing with the fallout.

“Do you know the way I’ve been treated by Donald Trump? I hate the guy,” Nunberg told CNN’s Erin Burnett. “He called me a low-level, part-time consultant? I was being laughed at for years. I supported him. He was like — he shouldn’t have been — but he was like a father to me.”