He routinely fibbed about ratings, declaring "The Apprentice" the No. 1 show on television even when, as NBC officials would sheepishly admit, it was not.
And he demanded a raise to $6 million from roughly $50,000 an episode during a lunch with Jeff Zucker, then head of NBC. It was only fair, he explained, because the cast of NBC's sitcom "Friends" earned the same amount — combined.
With its glamour and famous catchphrase — "You're fired" — "The Apprentice," which debuted in 2004, was the ultimate showcase for Donald J. Trump's self-styled image as a power-wielding mogul. But it also served as a prequel of sorts for his improbable next act as a presidential nominee, who next week will return to prime time as the ringmaster of the Republican National Convention.
More than Mr. Trump's real estate deals, the show transformed its star from a New York curiosity into a national sensation, introducing millions of viewers — and, later, voters — to a highly flattering, highly fictionalized version of Mr. Trump, more appealing than the real-life developer whose successes were tempered by bankruptcies and personal turmoil.
Mr. Trump, who had little previous television experience, revealed a showman's mastery of the medium, which he used this year to confound political opponents and seduce ratings-hungry networks. Those skills will be on full display at the convention in Cleveland, where Mr. Trump is personally wooing celebrities and overseeing stagecraft for a blowout spectacle that will be less C-Span, more MTV.
If "The Apprentice" was a vehicle for Mr. Trump to hone his craft as an entertainer, it also previewed darker aspects of his presidential campaign. Mr. Trump, producers say, casually indulged in ethnic stereotypes, once asking a network executive if a Jewish agent would earn him more money. Another time he pitched an "Apprentice" season pitting black contestants against white contestants, an incendiary proposal that NBC never pursued.
Even his less provocative behavior in the show's famous boardroom signaled troublesome traits that would later emerge on the campaign trail — a penchant for dividing teams against each other, blunt insults and occasional bullying.
In an interview in his Trump Tower office, Mr. Trump said that the difference between his reality show and his presidential bid was, simply, one of magnitude.
The show's creators, led by the reality show producer Mark Burnett, had planned a rotating cast of tycoon hosts — first Mr. Trump, then maybe Mark Cuban, Richard Branson or even Steven Spielberg.
Mr. Zucker, who is now the president of CNN, was so enamored of the concept that he shut his office door and told Mr. Burnett he could not leave until a contract was signed. But executives had a lingering concern: Would viewers be put off by the show's harsh climax, in which a churlish Manhattan titan dismisses a wide-eyed aspirant?
The line was a sensation on set, from the executives in the control room to the union men working the cameras. "What other person in America could make getting fired a popular thing?" said Jim Dowd, NBC's former publicity chief.
The host was proving to be popular, too. Shortly after the show began, fully one-half of Americans told Gallup that they held a favorable view of Mr. Trump, his best rating ever, up from just one-third a few years earlier.
Mr. Trump soon became obsessed with Nielsen ratings, a precursor of his now constant references to political polls. Mr. Trump even had his agent obtain the ratings early, so he could break the news to executives himself.
"It went from this apprehension and nervousness to, 'Yeah, I knew this was going to be a hit,'" said Mr. Dowd, whom Mr. Trump later asked to serve as press secretary for a possible 2008 presidential bid.
Mr. Trump eschewed cue cards on set, improvising most of his lines. Usually, he needed only a single take, although there were exceptions. Once, a windy helicopter landing mussed his famous hair, forcing him back to his limo for restyling.
Presaging the primary night parties he would later hold at Trump Tower, Mr. Trump insisted that the "Apprentice" set be built inside his Fifth Avenue skyscraper. Tara Dowdell, a contestant who has criticized Mr. Trump, remembers him giving behind-the-scenes tours to potential business partners.
He impressed NBC by traveling to casting calls, once suggesting that the contestants debate a newly passed immigration enforcement law in Arizona. He pitched himself as the host of the Emmy Awards, only to be informed that the show was carried by a rival network.
"The Apprentice" also enriched Mr. Trump, although there is disagreement over how much. Last year, Mr. Trump said he earned $213 million over his 11 years on the show, including his ownership stake in the series.
Still, some executives estimated that Mr. Trump may have collected roughly $100 million, including appearance fees, an ownership stake and lucrative sponsorship deals with companies like Chrysler.
But even as profits rolled in, some executives and contestants were unsettled by what they described as Mr. Trump's casually offensive comments, years before he would deploy racially charged statements on the campaign trail.
During salary talks, one Jewish executive, who spoke on the condition of anonymity, remembered Mr. Trump asking, "Don't you think I should get a Jewish agent, so he can negotiate better for me?" A spokeswoman for Mr. Trump had no comment when asked about the exchange.
Randal Pinkett, an African-American contestant who won the show's fourth season, said that Mr. Trump was never overtly racist. But he was taken aback during the finale when Mr. Trump suggested that he share his prize with the rival he had just defeated, a white woman.
Other contestants said that Mr. Trump did not act inappropriately. "My experience with him on 'The Apprentice' was completely different than the man I see speaking about hateful things," said Kevin Allen, an African-American entrepreneur who appeared in the second season.
Mr. Trump, whose "Apprentice" boardroom chair still decorates his office, remains deeply invested in the show: He is asking friends, executives and even campaign crowds about his successor as host, Arnold Schwarzenegger. "How do you think Arnold's going to do?" Mr. Trump said, several times, over the course of a 45-minute interview.
His presidential run has also raised the show's international visibility. Mr. Burnett, in an interview, said he had heard from potential hosts for foreign versions of the show, who believed it could propel them to higher office in their own countries. "They're thinking, 'If I do this show for four years, that's a great launchpad into politics,'" he said.
Privately, some in TV who helped build Mr. Trump's franchise now say they are alarmed at the prospect of his winning the White House. Others have been confronted by friends and family members, who wonder if they abetted Mr. Trump's rise.
"My son has said it to me, 'This is your fault, Dad,'" said Mr. Gaspin, the former NBC executive, with a laugh.
Asked about his salary negotiation with Mr. Zucker, Mr. Trump said that he was inspired by a New York Post article about the actors' salaries on "Friends," then in its last season.
Mr. Zucker, according to two people with knowledge of the lunch, responded by asking Mr. Trump if "The Apprentice" had enhanced the value of the Trump brand. Yes, Mr. Trump replied.
Follow Michael M. Grynbaum on Twitter @grynbaum. Follow Ashley Parker on Twitter @ashleyrparker.