BONN, SEPT. 11 -- A ransom of at least $2 million was paid to secure the release on Monday of a West German hostage who had been held by pro-Iranian militants in Lebanon, West Germany's leading news agency and a well-connected Lebanese magazine reported today.

It was not known who paid the ransom for businessman Alfred Schmidt, who was freed after more than seven months in captivity, the agency Deutsche Presse-Agentur (DPA) and the magazine Ash Shiraa said. But government and diplomatic sources here hinted strongly this week that Schmidt's employer, the West German electronics giant Siemens AG, had arranged to pay a ransom.

A Foreign Ministry spokesman today denied that ransom had been paid. Siemens has repeatedly made similar denials.

DPA quoted "reliable sources" for its report, which carried a Bonn dateline. The agency appears to have been used frequently by the West German government as a conduit for information about the cases of Schmidt and another German kidnaped in Lebanon.

Government and diplomatic sources said that another important factor in Schmidt's release was assistance given by the Iranian and Syrian governments, in part in response to West German diplomatic efforts in recent months.

DPA and Ash Shiraa backed up the West German government's public denial that it had promised the kidnapers an early release of Lebanese terrorist suspect Mohammed Ali Hamadei, who is imprisoned in Frankfurt, in exchange for Schmidt's freedom.

But Ash Shiraa said that the kidnapers had "received hints" that Hamadei would be freed "in a period that is not short and not long."

Hamadei is charged with air piracy and murder in the 1985 hijacking of a TWA jet during which a U.S. Navy diver was murdered. The West German government in June refused to extradite Hamadei to the United States, in part to safeguard the lives of Schmidt and Rudolf Cordes, the other West German hostage, who still is held in Lebanon.

Ash Shiraa said that Cordes would be freed in "coming days" if a second ransom is paid.

The magazine cited no sources for its account, according to news agency reports from Beirut, but it is believed to have good contacts with pro-Iranian Shiite militants in Lebanon. The magazine achieved instant international fame last autumn when it broke the story that the U.S. government had traded arms for hostages with Iran.

DPA said that the ransom was 5 million marks, or $2.7 million, while Ash Shiraa said it was $2 million.

The German news agency said the Bonn government had not paid any part of the ransom. It quoted "responsible" sources as saying that no ransom would be paid for Cordes.

Government spokesmen confirmed media reports that Schmidt, after his release, had told government interrogators that Cordes was still alive. Schmidt has been kept away from the media since his release, and it is not known where he is.

Government and diplomatic sources, who spoke on condition that they remain unidentified, said they were confident that the Bonn government had not made any promises to win Schmidt's freedom.

The sources said that Siemens and the chemical company Hoechst AG, which employs Cordes, may have arranged for a ransom to be paid.

The government has gone out of its way to thank Iran and Syria for using their influence with the kidnapers to win Schmidt's release.