In the middle of the Pakistani night, near the border with Afghanistan, a team of FBI agents dressed in native garb descended on a hotel room. One of those agents, Sean M. Joyce, kicked in the door, tackled a screaming Pakistani man and threw him to the ground.

The 1997 raid resulted in the capture of Mir Aimal Kasi, who was later executed for murdering two CIA employees outside the agency’s Langley headquarters. And it marked a milestone in the ascension of Joyce, who in September became the FBI’s deputy director, the bureau’s second-ranking job.

With his wire glasses, receding hairline and thick Boston accent, Joyce could be mistaken for a college professor or corporate executive. In fact, he nearly was — he graduated from business school, interned on Wall Street and fielded job offers from leading financial firms.

But Joyce, 50, was drawn to law enforcement because, he said, “there’s something more to life than just making a lot of money.’’ And though he has risen through the ranks since joining the FBI in 1988, colleagues said some agents have underestimated him because of his mild-mannered appearance.

They do at their peril.

FBI deputy director Sean M. Joyce (Courtesy of FBI/COURTESY OF FBI)

“He works out like a madman every single day,’’ said Joyce’s predecessor as deputy director, Timothy P. Murphy.

“The dude is in seriously good shape,’’ said Philip Mudd, a former senior FBI official.

Tales of Joyce’s intensity, drive and physical prowess are legion in the close-knit world of FBI agents. There was, for example, the day about 10 years ago when he was supervising the SWAT team in the Dallas field division.

A few agents were “messing around and wasting time,’’ recalled one agent, who spoke on the condition of anonymity because he is not an authorized spokesman.

Joyce made the entire team run three miles — with their gas masks on. But he earned their respect by leading the pack, wearing his own mask. “Everyone gets focused after a run like that,’’ the agent said.

There are also the times when Joyce tries to destroy fellow agents in the weight room. “He’s a type-A personality, an ‘Okay, I can do more pullups than you’ kind of guy,’’ said Michael Elsey, an FBI agent in the Fort Worth office.

“There are guys who say ‘I’m beat, I give up,’’ said Elsey, who calls Joyce the “perfect choice” for deputy director because of his experience and leadership skills. “He will never be one of those guys. He will try and beat you until his last breath.’’

Now, Joyce is trying to beat al-Qaeda terrorists, who are his top focus as he runs the FBI’s day-to-day operations with Director Robert S. Mueller III. Other priorities include cyber crime and economic espionage, along with maintaining the bureau’s traditional role in investigating crimes such as kidnappings and bank robberies.

But all is secondary to the FBI’s continuing transformation into an intelligence agency capable of preventing attacks, the focus since Sept. 11, 2001. Joyce is tackling that mission with his customary zeal.

“We are in a critical period right now” after the killings of Osama bin Laden and other militants, Joyce said, adding: “I compare it to when rival gangs have a fight. There are many people out there who want to seek revenge.’’

A Massachusetts native, Joyce has held a series of high-level FBI posts in recent years, including assistant special agent in charge of the Washington Field Office and, most recently, executive assistant director of the National Security Branch.

He was chosen for the No. 2 job because of his wide-ranging experience, expecially in counterterrorism, decisiveness and strong relationship with Mueller, people familiar with the process said. The sources, who spoke on the condition of anonymity to describe internal deliberations, said Joyce’s only perceived drawback was that he had never been a special agent in charge of a field office, a highly prestigious position that many previous deputy directors had held.

But the sources said Joyce has forged smooth relations with field office heads. He also won praise from the FBI Agents Association, which has occasionally been at odds with FBI management over issues such as the term limits Mueller imposed on supervisors.

“He’s a very intense individual, very enthusiastic,’’ said association president Konrad Motyka.

Joyce displayed that spirit during a recent interview, peppering his speech with superlatives to describe his career.

On pursuing sexual predators and robbers in Texas: “I made a lot of arrests, went to court a lot. It was great times.’’

On investigating Colombian drug cartels in Miami: “That was phenomenal. It really was a fun, fun time. I had a great informant.’’

On subduing Kasi, who had fled to Pakistan after the CIA shootings in 1993. “It’s a great story.’’

Joyce, who said he has no hobbies, reserved praise for his wife and three children, who support him through 16-hour workdays and weekend phone calls. “I can’t think of the last time I’ve had dinner with my family,’’ he said, before quickly adding: “That’s not meant as a complaint.’’