WASHINGTON — The Justice Department obtained a secret court-approved wiretap last October on Carter Page, a foreign policy adviser to Donald J. Trump’s presidential campaign, based on evidence that he was operating as a Russian agent, a government official said Wednesday.

The Foreign Intelligence Surveillance Court issued the warrant, the official said, after investigators determined that Mr. Page was no longer part of the Trump campaign, which began distancing itself from him in early August. Mr. Page is one of several Trump associates under scrutiny in a federal investigation.

The Justice Department considered direct surveillance of anyone tied to a political campaign as a line it did not want to cross, the official added. But its decision to seek a wiretap once it was clear that Mr. Page had left the campaign was the latest indication that, as Mr. Trump built his insurgent run for the White House, the F.B.I. was deeply concerned about whether any of his associates were colluding with Russia.

To obtain the warrant, the government needed to show probable cause that Mr. Page was acting as an agent of Russia. Investigators must first get approval from one of three senior officials at the Justice Department. Then, prosecutors take it to a surveillance court judge.