SEOUL, South Korea — Two South Korean spy chiefs who served under Park Geun-hye, the impeached former president, were arrested Friday on charges of illegally channeling tens of thousands of dollars a month from their agency’s secret budgets for Ms. Park’s private use.

The arrests resulted from a campaign by Ms. Park’s successor, President Moon Jae-in, to root out what he called collusive ties between the president’s office and the National Intelligence Service, long accused of meddling in domestic politics.

The former spy chiefs, Nam Jae-joon and Lee Byung-kee, were accused of delivering monthly payments of $45,500 to $91,000 to Ms. Park while they were serving as directors of the National Intelligence Service. The money was taken from the agency’s “special operational funds,” which were intended to finance undercover assignments and were not scrutinized by parliamentary or other outside auditors, prosecutors said.

Lee Byung-ho, another former spy chief who served under Ms. Park, faced the same accusations. But a judge did not approve his arrest on Friday, saying Mr. Lee was not at risk of fleeing the country or trying to destroy evidence if he was free awaiting trial.