By the evening of June 20, 2005, the government's investigation of possible insider trading by Pequot Capital Management, a prominent hedge fund, had reached a critical stage.

Throughout the day, Robert Hanson, a branch chief in the Washington office of the Securities and Exchange Commission, had been questioning his lead investigator in the case about taking the testimony of John J. Mack, an influential Wall Street executive.

The investigator, Gary J. Aguirre, was trying to find out if Mr. Mack had obtained inside information about a merger and passed it to his friend, Pequot's founder, Arthur J. Samberg.

Finally at 8:25 p.m., Mr. Hanson sent Mr. Aguirre a message from his BlackBerry expressing enthusiasm about the inquiry. "Okay Gary you've given me the bug," he wrote, according to confidential S.E.C. documents. "I'm starting to think about the case during my non work hours."

But three days later, the investigation abruptly changed course. Mr. Aguirre later told a Senate committee that after news broke that Mr. Mack was being considered to run Morgan Stanley, his supervisor said he could not interview the executive because of his political power. Mr. Aguirre protested and was eventually fired in September 2005, just days after receiving a two-step merit pay increase.

Mr. Mack and Mr. Samberg have both repeatedly denied any improper conduct. Earlier this month, the S.E.C. informed them that it would not bring any charges.

Now, it is the S.E.C. that is under scrutiny. Two Senate committees - Finance and Judiciary - are investigating how diligently the S.E.C. pursued its Pequot inquiry, whether Mr. Aguirre's firing was an attempt to silence him, and whether senior S.E.C. officials gave special treatment to Mr. Mack by not taking his testimony when Mr. Aguirre wanted to. Mr. Mack, a major fund-raiser for President Bush's 2004 campaign, was eventually interviewed last August, after Congress began asking questions.

The congressional inquiry centers on dozens of pages of internal S.E.C. documents that Mr. Aguirre turned over to Congress and were obtained by The New York Times. The documents, including e-mail messages from Mr. Samberg and his associates, as well as contemporaneous e-mails from investigators, provide the first inside look at the case, and shed light on why the two Senate panels are interested in the matter.

The primary focus of the congressional inquiry is the S.E.C.'s investigation into Pequot's purchase of stock in Heller Financial, a financial services firm, and the dispute over taking Mr. Mack's testimony. The documents say that Pequot became the nation's biggest purchaser of Heller stock in the four weeks before the company was acquired by GE Capital in July 2001. Mr. Samberg bet $44 million on Heller and wanted to invest even more, according to the documents, but his trader could not fill all the orders.

The file shows that after Mr. Aguirre was blocked from questioning Mr. Mack about the Heller deal, Mr. Hanson, the S.E.C. branch chief, acknowledged in e-mail messages that he had discussed Mr. Mack's "political clout" and the "juice" of his lawyers with officials at the commission.

In an exchange of e-mails in the summer of 2005, Mr. Hanson said that he had merely been trying to "alert folks above me," and that politics did not influence S.E.C. decisions. Mr. Aguirre replied: "Bob, this is spin. You told me it would be tough to take Mack's testimony because he has political clout."

In the documents, S.E.C. officials argued that Mr. Aguirre was not justified in taking Mr. Mack's testimony because he could not show that Mr. Mack had inside information or a clear motive for giving it to Mr. Samberg. But Mr. Aguirre said he was only asking for permission to interview Mr. Mack, not bring charges.

The file portrays the S.E.C. as a place where stock exchange referrals of suspected insider trading can languish for years without serious investigation.

In the Pequot case, senators are examining how the S.E.C. handled a total of 18 referrals. In addition to the Heller deal, they include an investigation involving federal prosecutors into whether the hedge fund bought Microsoft options based on inside information. E-mails show that Mr. Samberg solicited information about the software company's financial performance from a Microsoft manager he was recruiting shortly before Pequot invested in the company.

"I shouldn't say this, but you have probably paid for yourself already!" Mr. Samberg wrote to the former Microsoft manager as he was preparing to join Pequot in 2001.

None of the 18 referrals, including the one involving Microsoft, led to an enforcement action, according to people briefed on the matter.

Mr. Aguirre's documents have surfaced amid rising concern on Capitol Hill about the lightly regulated world of hedge funds. The chairman of the finance committee, Senator Charles E. Grassley, Republican of Iowa, said last week that after questioning S.E.C. officials about the Pequot investigation, "my initial concerns haven't been put to rest by what I've learned so far."

The file is not a full record of Mr. Aguirre's investigation, and it is silent about what happened in the inquiry after he left the commission. In the papers, Mr. Aguirre acknowledged before his firing that he had not proved that Pequot had engaged in insider trading, or that Mr. Mack ever had inside information about Heller.

Since The New York Times first reported Mr. Aguirre's allegations last June, the inspector general for the S.E.C. reopened his investigation into the firing after it was disclosed that he had not interviewed Mr. Aguirre. The inspector general, whose conduct is also being examined by the Senate, declined to comment.

Mr. Aguirre declined to be interviewed for this article, but in an Aug. 21 letter, he told the banking committee, which oversees the S.E.C., that he had little faith in either investigation. "The same I.G. who did the first whitewash would do the new one," he wrote. "The senior enforcement attorneys who pretended no grounds existed to take Mack's testimony will now pretend to take Mack's testimony."

In a statement, Jeanmarie McFadden, a spokeswoman for Morgan Stanley, said: "Mr. Aguirre's allegations against John Mack are irresponsible and without any evidence whatsoever to support them. John Mack had nothing to do with the S.E.C.'s decision if or when it would seek his testimony. As soon as he was asked, John Mack immediately agreed to provide his testimony and was subsequently advised that the S.E.C. would take no action regarding him in this matter."

Jonathan Gasthalter, a Pequot spokesman, said in a statement: "The S.E.C. staff conducted an extensive, two-year investigation of Pequot's trading and that investigation is over. During the course of the S.E.C.'s investigation, the U.S. attorney for the Southern District of New York reviewed the firm's 2001 trades in Microsoft and concluded that no action was warranted."

Officials at the S.E.C. declined to comment on the Pequot investigation and its outcome. But Walter G. Ricciardi, deputy director of enforcement, said that if investigators uncovered evidence that supported an insider trading case, they would pursue it vigorously. He denied Mr. Aguirre's contention that referrals from the stock exchanges languish, saying that the commission's staff follows up on three-quarters of the 350 to 450 referrals received each year.

"Insider trading is a very big priority for us," Mr. Ricciardi said. "We recognize that the integrity of the marketplace is at stake."

Focusing on the Heller Deal

The following account is largely based on the investigative files and letters Mr. Aguirre sent to Senate investigators in August.

According to these records, two days after joining the commission in September 2004, Mr. Aguirre was assigned to look into suspicious trading by Pequot in an information management company shortly before it was acquired in 2003.

In a matter of months, Mr. Aguirre said he discovered 13 referrals involving Pequot that had not been fully investigated by the S.E.C. Eventually, he would look into 18 referrals, including one older one where Pequot suddenly began buying the stock of Heller Financial.

That referral soon became the focus of the S.E.C.'s Pequot investigation.

What intrigued federal investigators, Mr. Aguirre said, was that before buying Heller stock, Mr. Samberg apparently did not follow the financial services industry or Heller. Mr. Samberg's bet had paid off: On July 30, 2001, the GE Capital Corporation announced that it was buying Heller, sending Heller's stock up 50 percent. Pequot made $18 million on the deal, primarily by investing in Heller, but also by short-selling GE Capital's parent, General Electric, which dropped on news of the buyout.

After the deal was announced Mr. Samberg sent an e-mail containing six "smiley" faces, Mr. Aguirre said.

According to Mr. Aguirre, Mr. Samberg told the S.E.C. in May 2005 that he had six reasons for buying Heller stock, including the company's strong financial model, analysts' reports and speculation that Heller might be a takeover candidate.

But Mr. Aguirre says that when Mr. Samberg testified a second time in June, he was less certain, saying he had "no recollection specifically of how I started the Heller investment other than to know that I had been doing this for many years and recognized these opportunities when they come up."

Mr. Samberg said he could not recall seeing any newspaper articles about Heller or point to any specific analysts' reports he had read about the company, according to an e-mail Mr. Aguirre sent to his supervisor, Mr. Hanson, on June 27, 2005. Nor did Mr. Samberg remember speaking with others at Pequot about the deal, Mr. Aguirre wrote. After Mr. Aguirre was fired, the S.E.C. interviewed Mr. Samberg a third time, but the files do not reflect what he said.

You are already subscribed to this email.

Beyond Mr. Samberg's testimony, Mr. Aguirre said his suspicions were fueled by Pequot's trading in Microsoft.

In early 2001, Mr. Samberg sought financial information on Microsoft from a product manager at the company, David Zilkha, whom he was trying to recruit, according to Mr. Aguirre.

"Might as well pick your brain before you go on the payroll," Mr. Samberg wrote in an e-mail message to Mr. Zilkha on Feb. 28, 2001. After expressing unhappiness with Pequot's research on Microsoft, Mr. Samberg asked: "Do you have any current views that could be helpful?"

Mr. Aguirre told the banking committee that between April 9 and 11, 2001, Mr. Samberg bought 30,000 options contracts, apparently believing Microsoft "would beat its earnings, the reverse of his belief stated in his e-mail."

A little more than a week later, on April 19, Microsoft reported better-than-expected earnings, sending its stock sharply higher the next day. Mr. Samberg made a $12 million profit on his Microsoft options, Mr. Aguirre said. The next day Mr. Samberg sent Mr. Zilkha, still three days away from joining Pequot, the gushing e-mail that said, "you have probably paid for yourself already." On Mr. Zilkha's first day on the job, Mr. Samberg alerted others to the new employee's "great p.& l." - or profit and loss - based on his Microsoft "input."

Mr. Aguirre told the banking committee that "critical gaps in the evidence" prevented the S.E.C. from charging anyone with insider trading in connection with the Microsoft investigation. The Justice Department also took no action.

Mr. Zilkha, who no longer works for Pequot, declined to comment. But his lawyer, Henry Putzel III, issued a statement: "David Zilkha worked in a nonfinancial capacity, primarily in marketing for the MSN division of Microsoft. For approximately five months before his employment at Pequot, Mr. Zilkha was on family leave from Microsoft. David Zilkha never obtained and did not communicate any material, nonpublic information, nor did he attempt to do so."

A Dispute Over Testimony

The Zilkha e-mail messages fed Mr. Aguirre's belief that Mr. Samberg might have had nonpublic information when, around the same time, he invested in Heller Financial. His suspicion fell on Mr. Mack, a longtime friend of Mr. Samberg's who was Pequot's chairman for several weeks in June 2005. "There are hundreds of Pequot e-mails referring to Mack, including a dozen in July 2001," Mr. Aguirre wrote in a June 2005 e-mail message to S.E.C. officials.

None of those e-mails show Mr. Mack passing on any tips about the Heller deal. Nor do they prove that he even knew about the deal before Pequot started buying Heller stock on July 2, 2001.

But what the e-mails and trading records do show, Mr. Aguirre believed, was enough circumstantial evidence to warrant taking Mr. Mack's testimony - a standard procedure in such a situation, he said - and to issue more subpoenas to Credit Suisse First Boston, the investment bank that advised Heller during its talks with G.E. Mr. Mack became chief executive of Credit Suisse in July 2001.

In e-mails to S.E.C. officials in the summer of 2005, Mr. Aguirre made his case, noting that Mr. Samberg and Mr. Mack were close and trusted each other, and that Mr. Mack was allowed to invest in hot Pequot funds and financings. In addition, Mr. Aguirre speculated that Mr. Mack might have learned about the upcoming Heller-GE Capital deal while negotiating his job with Credit Suisse. Mr. Mack began at Credit Suisse on July 12, 2001, a little more than a week after Pequot began buying Heller stock. Pequot continued to buy Heller stock in the following weeks.

"Samberg's aggressive buying of Heller suggests he received the tip shortly before July 2," Mr. Aguirre said in an e-mail to Mr. Hanson, his S.E.C. supervisor. And Pequot's e-mails show that Mr. Samberg and Mr. Mack spoke after the market closed on Friday, June 29, according to Mr. Aguirre. "That matched perfectly with Samberg's decision to begin buying Heller with a vengeance the next trading day after he spoke with Mack," Mr. Aguirre said in his letter to the banking committee.

The committee files show that until late June of last year, S.E.C. officials appeared to support Mr. Aguirre's investigation. Around that time, Mr. Aguirre said, his supervisors authorized him to contact the Federal Bureau of Investigation and a federal prosecutor about the investigation.

But when Morgan Stanley was considering hiring Mr. Mack as chief executive, Mr. Aguirre said, a regulatory official at the investment bank called to ask if Mr. Mack was a serious target in the Pequot investigation. The official "explained that the prospect of such an action against Mack could affect Morgan Stanley's decision whether to rehire him as its C.E.O.," Mr. Aguirre told the banking committee.

Before answering, Mr. Aguirre said, he consulted with his two supervisors, Mr. Hanson and Mark Kreitman, an assistant director of enforcement at the agency. According to Mr. Aguirre, Mr. Kreitman favored telling Morgan Stanley that Mr. Mack was indeed a target, but first he informed his boss, Paul R. Berger, an associate director of enforcement, by speakerphone.

With Mr. Aguirre listening in, Mr. Berger quickly overruled Mr. Kreitman, saying in effect that the S.E.C. would most likely not file charges against Mr. Mack and that nothing should be said to Morgan Stanley, Mr. Aguirre said.

Mr. Aguirre was stunned. He told the banking committee that after the call, "The usual routines and protocols went out the window." Suddenly, Mr. Aguirre said, he was excluded from senior staff meetings about the Pequot investigation. And subpoenaed records that ordinarily would go directly to him were instead directed to Linda Thomsen, the agency's chief of enforcement, he said.

Mr. Berger, now a lawyer at Debevoise & Plimpton, declined to comment.

For the next two months, Mr. Aguirre pressed his superiors for permission to take Mr. Mack's testimony. He failed to change their minds.

"I need greater specificity than the information provided here," Mr. Kreitman wrote in a July 25, 2005, e-mail to Mr. Aguirre. Mr. Kreitman said the evidence of motive "may have substance but it's too vague." And while contacts between Mr. Mack and Mr. Samberg "were potentially significant," they were not "aberrational."

"I have indicated repeatedly that concrete evidence of when Mack obtained access to material nonpublic information re the G.E./Heller deal is the sine qua non for focused investigation of Mack," Mr. Kreitman wrote.

To Mr. Aguirre, this standard had not been applied to other executives he had subpoenaed. Just as troubling, he said, were references by Mr. Hanson to the power of Mr. Mack and his lawyers, who included former S.E.C. officials.

"Mack's counsel will have 'juice,' as I described last night - meaning that they may reach out to Paul and Linda (and possibly others)," Mr. Hanson told Mr. Aguirre in an e-mail on Aug. 4, 2005. The reference apparently was to Mr. Berger and Ms. Thomsen.

Three weeks later, on Aug. 24, Mr. Hanson again acknowledged Mr. Mack's status. "Most importantly the political clout I mentioned to you was a reason to keep Paul and possibly Linda in the loop on the testimony," Mr. Hanson wrote. But he added: "As far as I know politics are never involved in determining whether to take someone's testimony. I've not seen it done at this agency."

Mr. Aguirre disputed Mr. Hanson's account, calling it "spin," and added: "An artificially high barrier has been set for his exam. I do not think this is proper."

Mr. Ricciardi of the S.E.C., speaking generally, said, "Every day enforcement deals with powerful people and we treat them equally with an appropriate level of fairness for the people being investigated and fierceness for the investors we protect." He also said that lawyers representing possible targets often approach top enforcement officials. "They don't have to be a famous lawyer, and they don't have to have a famous client," he said.

By the end of August, Mr. Aguirre was complaining that the Heller investigation "has slowed to a snail's pace." He was fired about a week later while on vacation.

In late August of this year, Senator Grassley, the finance committee chairman, wrote to the S.E.C. chairman, Christopher Cox, raising questions about how the agency handled the investigation. He wrote that congressional investigators had found that the S.E.C.'s Heller inquiry had stopped, and had resumed only after Congress began looking at the matter.

Senator Grassley also took the inspector general's office to task, saying it had shown little interest in Mr. Aguirre's contention that Mr. Mack's political clout was a factor in not taking his testimony last year.

The inspector general "closed its inquiry, claiming it found no evidence that S.E.C. officials had referenced Mack's political clout," Mr. Grassley wrote, adding, "Contrary to the I.G. report, however, documentary evidence exists and corroborates" that assertion.