The U.S. attack on an Iranian navy ship suspected of laying mines in the Persian Gulf Monday was carried out by Army helicopters from an elite counterterrorist task force specially trained and equipped to operate in darkness and bad weather, Pentagon sources disclosed yesterday.

The helicopter that raked the Iran Ajr with rockets and gunfire, they said, was a "spook" version of the Hughes OH6 scout chopper employed by Task Force 160 at Fort Campbell, Ky., a low-profile, fast-response unit designed to rush undetected into terrorist or hostage situations almost anyplace in the world.

The helicopter, called an MH6 within the special forces community, is armed with machine guns and 2.75-inch rockets, which scatter shrapnel over a wide area to maximize the chances of hitting a small target like the Iranian ship. The MH6 also is equipped with an array of night-detection devices for stealth operations, which most Navy helicopters in the gulf lack.

Pilots and gunners flying this special helicopter wear high-technology night-vision goggles so they can see with only a little starlight and moonlight.

There were conflicting reports from the Pentagon and Persian Gulf as to whether more than one of the special helicopters carried out the attack.

Task Force 160 is sometimes called "the wings of Delta Force," the crack troops normally quartered at Fort Bragg, N.C., who have been sent to respond to several Mideast hijackings in recent years but had not engaged an adversary. The Pentagon does not acknowledge publicly the existence of Delta Force or its aerial counterpart, though their existence has become an open secret.

Calling themselves "Night Stalkers" and using "Death waits in the dark" as a motto, Task Force 160 pilots practice flying at low level during the darkest nights. Their flight training has proved highly risky, but Adm. William J. Crowe Jr., chairman of the Joint Chiefs of Staff, favored adding their night operational capability to the U.S. Persian Gulf fleet, sources said.

Crowe, who formerly commanded ships in the gulf, recommended several months ago -- when President Reagan was considering escorting Kuwaiti tankers through the strategic waterway -- that Army helicopters with night-operating capabilities be placed aboard Navy ships, according to Pentagon officials. He also requested mine-detection capability, they said.

Last Monday and Tuesday, Pentagon officials said, Crowe hopscotched from one ship to another in the gulf explaining the rules of engagement if a U.S. helicopter or ship spotted an Iranian vessel laying mines. His message, one official said, was that laying a mine was a hostile act that permitted return fire.

Crowe personally delivered this message, sources said, to Rear Adm. Harold J. Bernsen, commander of the Middle East Force, during a visit aboard the USS LaSalle, the U.S. flagship in the gulf, and to other top officers during visits to the USS William H. Standley, a guided-missile cruiser, and the USS Raleigh, an amphibious transport.

The rules of engagement were so clear on the right to fire, one official said, that Persian Gulf commanders did not seek clearance from the Joint Chiefs or other Washington superiors before Monday's aerial attack against the Iranian ship. The helicopter crew got approval from Bernsen, officials said, before opening fire.

Military leaders, criticized for not anticipating the mine threat that damaged the supertanker Bridgeton in July, yesterday relished what they called the "jointness" -- individual services working as a team -- demonstrated when Army helicopters flew off Navy ships and hit a small Iranian ship while laying mines in the dark.

Although Pentagon officials said yesterday that Navy Seals who boarded the stricken Iranian craft got there by small boat, Task Force 160 pilots are adept at dropping Seals, the Navy's sea-air-land commandos, in the water close to the intended target. Helicopter pilots also practice making quick, disabling attacks on passenger aircraft being held on the ground by hijackers.