Veteran Spanish Communist Santiago Carrillo, who was overwhelmingly rejected by voters in the Oct. 28 national elections, today stepped down from the leadership of the party that he has run with iron discipline for 22 years.

He resigned as party secretary general at a stormy executive committee meeting that was holding a post-mortem into the election rout. The Communist Party representation in the congress shrunk from the 23 seats it held after elections in 1979 to just four seats and its percentage share of the national vote dropped from 10 to 3.8 percent.

Carrillo proposed as his successor Gerardo Iglesias, 37, Communist leader of the coal mining Asturias region in northern Spain. Iglesias, who is largely unknown in national politics, served a five-year prison term under the late dictator Francisco Franco. He joined the party at the age of 15 when he was already a miner and has a long record as a party organizer in the pits.

Carrillo's resignation brings to a head a simmering internal party feud over his stern leadership and the strategy he charted for the Spanish Communists. The party's Central Committee is scheduled to meet in closed session to consider his proposal that Iglesias become the new leader. Party sources indicated the session could be sharply divided.

Carrillo, 67, had been under attack by hard-liners for veering too far from Moscow and by dovish dissidents who accused him of not practicing the internal democracy he preached. His total grip on the Spanish party has been sharply eroded and the party has become a drastically reduced power base.

Last year, dozens of well known Communists, mostly lawyers, economists and members of other professions, left the party charging that Carrillo impeded the growth of a broad-based, moderate communist movement. At the same time, Moscow supporters, who objected to Carrillo's outright criticism of martial law in Poland and of the invasion of Afghanistan, defected to form rival Communist groupings.

As the sole survivor of the 1930s in a prominent political position, Carrillo was at odds with a new generation of Spaniards born in the postwar years. The right wing would not ignore Carrillo's alleged role in mass shootings of conservative prisoners by republican militias during the bitter civil war in the 1930s.

Once an unswerving Stalinist, Carrillo espoused democratic socialism and notably Eurocommunism in the 1970s to become, along with Italian Communist leader Enrico Berlinguer, a leading critic of Moscow's orthodoxy. He found, however, that the Communists have been outflanked as a parliamentary left-wing party by the Socialist Party, which won the Oct. 28 vote outright.

Carrillo, however, is generally considered to have helped consolidate Spanish democracy. On his return to Spain from exile after the death of Franco, he persuaded the party to accept the monarchy of Juan Carlos, tone down its radicalism and work within the constitutional framework.