CAMBRIDGE — As the lights rose, Ted Cruz held center stage, dressed in black and kneeling at a bedside. The first-year student at Harvard Law School delivered his lines with the emotions of a man gripped by anger, fear, and worry for his reputation.

“Do you understand that I have many enemies?” he thundered. “There is a faction that is sworn to drive me from my pulpit. Do you understand that?”

Cruz, then a devoted amateur thespian, was playing the role of the Rev. Samuel Parris in “The Crucible,” Arthur Miller’s allegorical play about McCarthyism.

The lines — and the part — seem prophetic today.

In the US Senate, the Tea Party Republican from Texas has continued to seek out a spot at center stage. His enemies — and he has many, including some in his own party — characterize him as power-hungry, self-righteous, driven by single-minded political piety. He even mounted what detractors called a groundless witch hunt, against the presidential nominee for secretary of defense.

Interviews with more than two dozen alumnae and professors fill in a portrait of Cruz, in Cambridge two decades ago, that would be fully recognizable to those who know him now in Washington. He made a lasting impression as someone both arrogant and pretentious, as well as someone unwilling to yield or compromise.

But he was also universally respected for his intellect, described by friend and foe alike as brilliant but with a hard edge.

“He never really had an off switch with his debater’s demeanor,” said Ted Ruger, who was president of the Harvard Law Review during Cruz’s third year. “We just realized that was the way a discussion with Ted was going to go. If you expected something different, you came away shaking your head.”

Some two decades later, Cruz has deftly tapped into a rebellious, angry strain in American conservatism and emerged as a leader in the Tea Party movement. He was a primary force behind last month’s government shutdown, and has been mentioned as a possible 2016 presidential candidate.

The man who prodded his colleagues on the Harvard Law Review is now the one drawing the ire of his Senate colleagues. He remains more notorious than popular.

Looking back, Cruz said those three years at Harvard Law School, from 1992 to 1995, sharpened his political vision and trained him for the intense sparring with liberals that has become his signature style as a national politician.

But he also said he has mellowed since then.

“I suspect I was not the first 21-year-old who thought he knew more than he did,’’ Cruz said in an interview in his Senate office. “And one of the virtues of age, one of the virtues of getting married and becoming a father, is it often leads one to take a more measured approach to life.”

Born in Canada

Ted Cruz arrived in Cambridge as an outsider.

He was born in Alberta, Canada. His father fled persecution in Cuba, eventually settling in Austin, Texas, where he learned English and earned a college degree.

After growing up in the Houston area, Cruz studied public policy at Princeton, where he developed a reputation as a quick-witted national debate champion. His near-perfect score on the LSAT helped him fulfill a dream of going to Harvard Law School.

It was a long way from Texas. Cruz’s father called it “missionary work,” a place that would allow his conservative son to preach to the liberal elite. And Cruz’s strident views stood out as much as the cowboy boots he wore to class, or the large Texas flag in his dorm room.

“Going to school on a campus where the faculty overwhelmingly disagrees with you, and where the student body overwhelmingly disagrees with you, is challenging,” Cruz said. “If you go in without a firm foundation, it can undermine what you believe.”

Cruz enrolled in 1992, a year after President Obama left and just as Elizabeth Warren began teaching as a visiting professor (she never taught him). He immediately stood out academically, even in a class of 560 of the country’s brightest students.

“He came in with his right hand raised and basically kept it raised the entire semester,” said Alan Dershowitz, who taught Cruz in a first-year criminal law class. “Every year you see two or three students who you know are natural leaders. Everybody saw that with Barack Obama . . . Everybody saw that with Elena Kagan. There are students who come in with charismatic qualities who other people follow. He was one of them.”

While talkative and outgoing, he struck some classmates as nakedly ambitious.

As they were entering their second year in law school, Melissa Hart agreed to give Cruz a ride from New York, where Cruz was at the end of the summer, back to Cambridge. She didn’t know him well, but he sought her out after she had been given a prestigious award for first-year students.

A former roommate told the magazine GQ recently that Cruz preferred to study only with graduates of Harvard, Princeton, or Yale, dismissing the rest as “the minor Ivies.”

“It’s complete nonsense,” Cruz said. “It’s simply not true.”

The five-member study group included one member, Jeff Hinck, who attended Northwestern.

Law Review post

Cruz lived in Hastings Hall, a six-story brownstone behind wrought-iron gates. The Hemenway Gymnasium, where he played intramural basketball and volleyball, was 40 steps away; Gannett House, which housed the Harvard Law Review, was 70 more.

Occasionally he would venture into Harvard Square for Mexican food or a movie. He avoided Boston, although one classmate recalls Cruz being the only one willing to shell out money to see Michael Jordan in the Boston Garden in his second game back from his brief baseball career (Cruz can still recount the box score).

In his second year, Cruz joined the Law Review and became a principal editor. He was also a founding editor of the Harvard Latino Law Review (where he is listed as “Rafael E. Cruz”) and joined the conservative Harvard Journal of Law and Public Policy (“R. Ted Cruz”).

Cruz focused primarily on his studies, and the law journals. But he stayed up late playing marathon sessions of “Super Mario Brothers” on the Nintendo, or cards. If the game was hearts, his signature move was to “shoot the moon,” the game’s riskiest, showiest, and most aggressive maneuver.

“It’s hard to execute,” said Charles Morse, a law school friend. “Ted was fond of that.”

If the game was poker, he put all his chips on the table.

“He would go all in sometimes . . . and you’d never know if he’s bluffing,” said Alexander Acosta, another friend. “He’s someone who’s willing to take risks.”

He also enjoyed antagonizing liberal classmates. Late nights at the Law Review were the scene of fierce debates. Cruz’s beliefs are no different now, and when it came to taxation classmates recall him arguing that the government was stealing money from the rich and giving it to the poor.

“Some topic would come up and it was a free for all,” said Dean Newton, a fellow conservative on the Law Review. “All you’d have to do is say something remotely conservative and it would catch people’s hair on fire. It was fun to goad them.”

Poking at turtles

Newton compared the sparring he and Cruz would engage in with Harvard liberals to poking at snapping turtles stuck at the bottom of a barrel.

“It didn’t take much of a stick,” he said. “And they would immediately snap.”

But with Cruz, those arguments became heated. It wasn’t just the substance, but how Cruz presented his case. To his adversaries, he was relentless. To his allies, he was misunderstood.

“Some people think his language is hard,” said David Panton, Cruz’s longtime best friend, and his roommate their first year at Harvard Law School.“But he’s a litigator. He has strong views and he makes his points clearly and empathically.”

Ted Cruz was, and in many ways still is, an actor.

In high school, he says, he considered dropping out and moving to California to pursue an acting career. His parents talked him out of it.

Shortly after he got to Harvard, he auditioned for “The Crucible,” which the law school drama society was staging to mark the 300th anniversary of the Salem witch trials.

Miller’s play was written during Senator Joseph Mc-Carthy’s Communist witch hunt in the 1950s. Since becoming a senator, Cruz’s critics have likened him to McCarthy for suggesting, without evidence, that Defense Secretary Chuck Hagel might have accepted money from extreme or radical groups. The comment drew a rebuke from Senator John McCain, who later called Cruz a “wacko bird.”

Cruz rejects comparisons of himself to McCarthy, suggesting he is the one being judged.

“It’s a tremendous play,” he said. “And it is obviously a lesson against jumping to conclusions and being unfairly and harshly judgmental of others. That is a lesson I wish a lot more in Washington would take heed of.”

To the play’s cast members, “The Crucible” is memorable for another reason.

After the successful first performance, Cruz spent the cast party imbibing so much Everclear — a powerful grain alcohol — that he couldn’t make it through the next night’s performance. His fellow actors had to coax him into going onstage, but by Act III his condition worsened.

A video of the performance shows him sitting on a bench onstage, his head buried in his hands for nearly five minutes straight. After meekly delivering a line, he walked off stage in the middle of the scene, forcing cast members to improvise around the departure of a lead character. He didn’t return for the remainder of the play.

“I was not feeling well, which was unfortunate,” Cruz said, taking a philosophical view of the experience. “The young are not renowned for their wisdom. And that’s certainly not a principle from which I was exempt.”

Asked if he’d had a sip of Everclear since, he replied, “I doubt it.”

It was a rare display of weakness for someone who otherwise seemed determined to succeed.

From the moment Cruz stepped onto the Harvard campus, he was intent on winning a clerkship with Supreme Court Chief Justice William Rehnquist, a fast track to conservative legal prominence.

“From day one . . . that was his tangible, near-term goal,” said Jeff Hinck, a study partner.

Cruz was so driven to secure a clerkship that he resolved to learn tennis, since Rehnquist, an avid player, was known to organize weekly matches with his clerks.

When he finally got an audience with Rehnquist and was asked if he was willing to play, Cruz, while allowing that he was “not very good,” eagerly agreed.

He got the job, but paid a price.

“What he didn’t realize until later was that ‘not very good’ was an incredible boast,” Cruz said. “I was so horrifically bad at tennis.”

Looking beyond campus

At Harvard Law, Cruz was a member of a small band of conservatives whose politics were out of step with most of their peers. But beyond campus, conservatism was a gathering force.

As the 1994 elections approached, with Newt Gingrich leading the charge, Cruz and his friends threw a “Republicans Take Back the House Party,” in Hastings Hall. When Republicans triumphed, the campus conservatives erupted in cheers — antagonizing Harvard’s liberals with their raucous celebration.

“I walked in and there were people going crazy,” said Matt Bodie, one of Cruz’s liberal classmates. “I said, ‘Oh I gotta get out of here.’ But there were some very happy conservatives.”

By the time he left Cambridge, the right wing in American politics was ascendant and Cruz, with his newly minted Harvard Law degree, was one of its brightest young stars.

Shortly after graduating magna cum laude, he took out a loan and bought his mother a new Saab convertible for her birthday. Then he embarked on the series of prestigious clerkships that planted the seeds for his political career.

Inside his Senate office, on a shelf with some of his writings in Harvard law journals, he keeps a baseball cap that has the words “WACKO BIRD” on it, memorializing the term McCain gave him.

As Cruz leaned back in his chair, nursing a cold following a weekend trip testing the presidential waters in Iowa, he reflected on the lessons he took from Harvard Law School. And that man who has so roiled the Republican Party, and upset Washington for his demeanor and his tactics, said there needed to be more civility.

“There is a depressing tendency in modern political life to disparage those who disagree with you as either stupid or evil,” he said. “’They’re either too dumb to know the right answer or, even worse, they’re smart enough and yet they wish suffering on others and are just downright evil.’ The truth of the matter, most people are neither.”