A high-level Soviet official, in Spain to "strengthen relations" with the maverick Spanish Communist Party, warned today that if Spanish Communist leader Santiago Carrillo "slanders" Moscow on a trip to the United States, "we will criticize him again."

Victor Atanasiev, editor of the Soviet party newspaper Pravda, had a place on honor on the speakers' stand at a massive rally here. He stressed to reporters covering the rally, however, that relations between the Spanish and Soviet parties "continue to have some difficulties."

Carrillo, along with the French and Italian party chiefs, has spoken out for greater independence from Moscow for other Communist parties. His book "Eurocommunism and the State" was attacked bitterly by Moscow.

Carrillo is scheduled to give lectures at two American universities late next month.

A large crowd at Casa de Campo park cheered Carrillo, and Dolores Ibarruri (La Pasionaria), 82, the Spanish party's ailing president.

Carrillo is also planning to visit Moscow next month for the celebrations of the 60the anniversary of the Soviet revolution.

The Soviet visitor, who is a member of his party's Central Committee, indicated in an interview that he and other Soviet officials will have serious ideological talks with Spanish political leaders before returning to Moscow next weekend. Apparently the principal object is to go over differences and tone down the quarrel before Carrillo goes to the United States.

The Soviet official made it clear that Carrillo's book will not be published in the Soviet Union. He said it raises "many points with which we are not in accord," adding that "in our country many would not understand the book."

The book and the bitter debate with the Soviet party has brought Carrillo international renown.

Spanish diplomats have indicated that during his U.S. visit Carrillo may go to Washington where he could have low-level talks with U.S. officials. No confirmation of this could be obtained here.

Next week Carrillo is scheduled to go to Paris for the publication of the French edition of the book. French and Italian Communists have supported Carrillo's thesis of independence from Moscow, but there are signs of disagreement between him and French Communist leader Groges Marchais.

The Spanish Communist Party's weekend "fiesta" was the biggest concentration of Spanish and foreign communists in Madrid since the 1936-39 in civil war. Atanasiev recalled that the Soviet Union had supported the Communists and their allies in the fight against the victorious forces of dictator Francisco Franco "with planes, tanks and pilots."

Also present at the weekend celebration, which ended with a speech by Carrillo this afternoon, were party delegations from Bulgaria, France, Greece, Hungary, Italy, Japan, Poland, Romania, East Germany and Yugoslavia. Most of them had stands in the park's fairground.

The Spanish and Soviet parties appear to want to maintain a correct attitude toward each other despite their differences. Carrillo indicated this in a recent talk, but he is not about to abandon his independent "Eurocommunist" position, although he may mute his criticism of the Soviet Union. He has called for a dialogue with the Soviets.