A day after President Reagan warned Iran to halt attacks on neutral shipping, an Iranian speedboat attacked a Saudi tanker in the Persian Gulf, and a pro-Iranian group in Lebanon threatened to kill two American hostages in retaliation for U.S. aggression.

A gulf-based shipping source said there was no immediate indication U.S. forces were preparing to retaliate for Sunday's attack on the Saudi-owned, Liberian-registered Sea Trader.Shipping sources said one of six marauding Iranian speedboats fired rocket-propelled grenades and machine-gun bullets into the 37,011-ton Sea Trader, owned by the Bakri Navigation Co. of Jeddah, Saudi Arabia, as the five other speedboats stood aside.

"Under Iranian attack!" cried the Sea Trader's skipper as the vessel came under fire while steaming through the strategic Straits of Hormuz toward Saudi Arabia, the sources said.

No casualties were reported among the tanker's Indian crew, and the Iranian attack did not ignite a fire.

One shipping source said the Sea Trader was heading to the United Arab Emirates port of Dubai for repairs after sustaining minor damage.

It was not known whether the Iranian speedboat in the attack was involved in a clash with U.S. naval forces a week ago. The clash April 18 left six Iranian vessels sunk or badly damaged and a Marine helicopter gunship with two crewmen aboard missing. Iran said 15 of its sailors were killed.

In Beirut, Lebanon, a pro-Iranian extremist group Sunday threatened to kill the two U.S. hostages it holds in retaliation for what it called "increasing American aggression" in the gulf.

The Revolutionary Justice Organization made the threat in a one-page statement delivered to the west Beirut offices of an international news agency.

"Any new aggression under any pretext regardless of justifications will lead to executing the spy Edward Tracy first and (Joseph) Cicippio second," said the statement, which was accompanied by a photocopy of an identification card bearing a black-and-white picture of Tracy taken before his abduction.

Tracy, 55, a convert to Islam and a book salesman, was kidnapped Oct. 21, 1986. Cicippio, 56, was seized Sept. 12, 1986 at Beirut's American University, where he was deputy comptroller.

"The aggressions taking place in the gulf will not go unpunished. Our logical retaliation for the invasion and the insolent aggressions leave us with no choice but moving the battle to inside America where things will run out of hand," the statement said.

Reagan, in his weekly radio address Saturday, affirmed U.S. neutrality in the gulf war, calling his retaliatory attack on Iran a closed incident but warning Tehran that continued aggression against non-belligerents will be "very costly."