One of the major factions in the Spanish Communist Party today rejected party leader Santiago Carrillo's Eurocommunist strategy and adopted an openly pro-Moscow stance that included an endorsement of the Soviet invasion of Afghanistan.

The decision of the party's branch in Catalonia, whose industrial belt around Barcelona accounts for roughly one third of Communist strength in the country, appeared to foreshadow a major internal crisis for the Spanish party, which along with the Italian and French Communist parties initiated the Eurocommunist strategy of a "democratic path" to socialism in the mid-1970s.

As in the case of the French Communists who reverted to distincly hard-line policies two years ago, the Catalin Communists blamed the lack of a "revolutionary leadership" for a spectacular drop in membership and virulently assailed the moderation pursued by Carrillo's leadership.

The semi-autonomous Catalan branch, which is known as the United Socialist Party of Catalonia, has fallen from 40,000 card carrying members in 1978 to just over 20,000 today.

At the end of a stormy, four-day local congress in Barcelona, the Catalan Communists voted to suppress the defining label "Eurocommunist," which has been the party's ideological platform to distance itself from Moscow and gain respectability as a democratic, parliamentary force.

The congress was strongly critical of Eurocommunism in general, charging that the official ideology of the Italian and Spanish parties was both "ambiguous" and "reactionary." It called on the national party to follow the French and Portuguese Communist parties in aligning itself openly with Soviet foreign policy.

Observers here said the outcome of the Barcelona congress was especially significant because the Catalans traditionally have been in the vanguard of the Spanish communist movement and constituted one of the most enthusiastic supporting groups behind the Eurocommunist strategy in the early 1970s.

In an unprecedented break with the usually well-orchestrated congress, the Catalans overturned motions critical of the Soviet Union that had been inspired by the Central Committee and endorsed hard-line resolutions backing Soviet policy in most areas including the invasion of Afghanistan. The congress replaced party officials closely associated with Eurocommunism and independence from Moscow with a new local executive dominated by pro-Soviet hard-liners.

Carrillo broke with Moscow as a result of the 1968 invasion of Czechoslovakia and has since consistently backed a "socialism with a human face" tailored to meet the political options of an industrialized, consumer society such as Spain's. He achieved respectability with the legalization of the Spanish Communist Party after the death of Gen. Francisco Franco and now controls a 23-strong group in the 350-member Spanish Congress. Eight Communist deputies come from Catalonia.

Underlining the triumph of the pro-Soviet line in Barcelona was the adoption of a series of markedly radical resolutions that ranged from a call to replace the monarchy with a federal republic to the endorsement of a motion of supporting the right of Catalonia to self-determination. In theory, both constitute violation of the law and could make the Catalan party subject to prosecution. Carrillo, mindful of conservative and military opinion, persistently has stressed the unity of Spain, and he has frequently praised the vital role played by King Juan Carlos in Spain's transition to democracy.

The pro-Soviet delegates claimed that Eurocommunists spent more time criticizing Moscow than denouncing "Western imperialism."

Sources close to the Communist leadership in Madrid said that there was evidence that the Soviet Embassy here had played a role in packing the Barcelona congress. Representation had been weighted toward favoring hard-line, radical delegates from the industrial belt known as the Bajo Ilobregat where unemployment is currently running at more than 12 percent.

In a veiled public reference to such Soviet role, Ignasi Riera, a journalist working for the Catalan Communist newspaper Treball until the congress forced his resignation, wrote in the Madrid daily El Pais today, "It is possible to see direct influences and, why not admit it, direct financing behind the pro-Soviet actions" at Barcelona.

Ironically, Carrillo is also under attack from the more liberal sectors in the communist movement who charge that voters and militants are turned away from the party by his own rule over the organization and his refusal to promote internal democracy. With a national congress scheduled for the summer, Carrillo's leadership and the unity of the Spanish Communist Party appear to be at stake.