LIMA, Peru (AP) _ Leftist guerrillas shot and killed a U.S. agricultural adviser and his Peruvian colleague, then wrote in red ink in the American's notebook, ''This is the way the lackeys of Yankee imperialism die.''

Constantine Orson Gregory, 25, of Los Angeles, and Gustavo Rojas, 35, of Lima, were killed Monday on an isolated road in the central Andes Mountains, said police Col. Cirilo Pacheco.

Pacheco said Wednesday that three Shining Path guerrillas halted the agronomists' pickup truck, checked their papers and then shot each man twice in the back of the head.

The attackers dynamited the agronomists' truck and escaped, and 30 suspects have been arrested in sweeps of the region, he said.

The two men and Gregory's American wife, who is expecting a baby, were living in Aramachay, a hamlet without electricity or piped water 15 miles north of Huancayo, a major city 125 miles east of Lima, said officials of the National Agrarian Research Institute.

Gregory's wife, Dolores, was not in the truck.

Last Thursday, pro-Cuban guerrillas lobbed three mortar rounds at the residence of U.S. Ambassador Alexander Watson in Lima, causing minor damage and no injuries.

In another attack Tuesday, a column of Shining Path rebels swarmed into Huallay village in the highland state of Ayacucho, killing 14 peasants who belonged to a civil defense patrol organized by the army, police said.

The U.S. Embassy said Wednesday that Gregory and Rojas were teaching peasant farmers methods to improve production of sheep and small farm animals.

The Shining Path, an eight-year-old Maoist insurgency, frequently assassinates development workers in Peru's impoverished highlands in an effort to sow economic chaos.

Gregory had been working on the project only a few months and was preparing to return to the United States in August to pursue a doctoral degree, said a U.S. development official who spoke on condition of anonymity.

The embassy said the men worked for the institute on a project funded by the U.S. Agency for International Development near Huancayo.

They were traveling from Aramachay to buy supplies in the town of Sincos five miles away when the attack occurred, said institute spokesman Javier Recuenco.

In the only other U.S. death linked to the guerrilla war, a Texas woman was among seven passengers killed and 28 wounded when guerrillas bombed a tourist train heading for the Inca ruins of Machu Picchu in June 1986.

AID has about 20 Americans in Peru and employs dozens of other U.S. and Peruvian citizens under contract agreements, the Lima AID office said. The agency spends more than $50 million yearly on agriculture, health and food relief programs, officials said.

The Shining Path guerrillas launched their insurgency in Ayacucho state. Although the Andes remain their stronghold, the violence has spread through much of the country.

The government says more than 10,000 people have been slain in the rebels' drive to impose a Marxist state.