More than 2,000 militant Iranian students tied up traffic and startled lunchtime crowds in downtown Washington yesterday, as they protested U.S. military aid to Iran and called for "Death to the Shah."

Raising their fists in union and shouting for the overthrow of Shah Mohammed Reza Pahlavi's regime in their native Persian, the masked protesters marched up Connecticut Avenue as D.C. police closed off the traffic and shepherded the marchers along.

A brief but tense confrontation occurred later on Massachusetts Avenue NW when helmered police blocked the protesters' march on the Iranian embassy. Demonstration marshals forcefully restrained some of their fellow protesters and persuaded them to march back down Massachusetts Avenue through downtown and then to the Capitol.

Altogether, the demonstrators marched seven miles during the hot breezy day, winding slowly through much of the central business district, slowing traffic and drawing complaints from motorists and pedestrians alike.

Business executives with briefcases looked on impatiently from the curb. Taxi drivers complained that the police constantly rerouted them around the marchers, making it difficult to reach their destinations.

The demonstrators - a broad cross-section of Moslem radical students representing at least four differentorganizations - staged the march simultaneously with others planned in San Francisco and several cities in Europe to coincide with protests in Iran being held to commemorate the bloody June 5, 1963, uprising and attempted coup by radical forces against the shah. Iranian troops and police were called out in massive numbers at the time, and radical leaders say 15,000 persons were killed.

Yesterday's demonstration in Washington was the latest in a series of protests by Iranian students here during the last several years.

Last November when the shah arrived for astate visit, several hundred students attacked pro-shah demonstrators in a wild stick and bottle-throwing melee on the Ellipse, injuring more than 124 persons, including several police officers.

Since then police have turned out in large, riot-garbed numbers for Iranian student demonstrations. Yesterday was no exception. There were at least 150 U.S. Park Police officers in Lafayette Park where most of the demonstrators assembled. Several hundred additional Park, D.C. and Capitol police were held in reserve throughout the day at key points in the city.

Park Polie confiscated about 50 heavy poles and baseball bats from demonstrators in Lafayette Park before the crowd began its march up Connecticut Avenue, R Street and Massachusetts Avenue toward the Iranian Embassy. As the marchers approached the bridge crossing Rock Creek Park on Massachusetts Avenue near the embassy, the front rows of marchers suddenly began running in lock step toward police massed to stop them. They stopped inches from the line of officers who were holding riot sticks at their chests. The marchers then began shouting and occasionally pushing at the police.

Demonstrations marshals finally locked arms and formed a line between the police and protesters, forcing the two apart. Tempers cooled. The demonstrators turned around and began the long march back downtown and then on to the Capitol.

There they rallied on the West Steps before returning to Lafayette Park near the White House. They thus carried their message to three primary targets - President Carter, Congress and the Iranian government.

In Iran, a general strike by opponents of the shah was called to coincide with demonstrations here and succeeded in shutting down parts of Tehran, the capital, and three other cities. No violence was reported by wire services, although demonstration leaders here told protesters that Iranian police had reportedly killed 20 persons and arrested at least 2,000.

Disruption of traffic and inconvenience to pedestrians was about all that happened here, but many downtown workers were unhappy about it.

tr for add five

Vernon Gill, D.C. Police general counsel, said in an interview yesterday, however, that limited or temporary inconvenience to the general public must be "weighed and balanced" with First Amendment rights of assembly, including parades or marches on public streets, a proviso that applies to citizens and noncitizens alike.