SAN JUAN, Puerto Rico (AP) _ The loss of a Puerto Rican pilot in the air raid on Tripoli, Libya, has stirred nationalist pride among the people of this U.S. commonwealth in the Caribbean.

''Puerto Ricans have participated with distinction in every war since World War I,'' said Gov. Rafael Hernandez Colon, who ordered the commonwealth flag flown at half staff for three days.

''My hope is that this Puerto Rican life which was lost will result in a genuine contribution to the cause of security and ... liberty,'' he said.

A brother of Capt. Fernando Ribas Dominicci, pilot of the one U.S. Air Force F-111 fighter-bombers that did not return from the raid, said friends and acquaintances had told him they felt pride in Fernando's sacrifice.

''He liked it (his military career) so much he gave his life,'' Carlos Ribas Dominicci said Thursday in a telephone interview. ''He was a good man and a good soldier.''

Julio Enrique, another brother of the 33-year-old pilot, said: ''He believed that the American nation (was) doing everything good for the welfare of the planet Earth.''

Leaders of Puerto Rico's independence movement used the pilot's death to criticize the United States.

Sen. Ruben Barrios, president of the Puerto Rico Independence Party, said Hernandez Colon's support of President Reagan was ''shameful ... especially when, by an incredible colonialist coincidence, the first victim is a Puerto Rican.''

The Defense Department does not know how or exactly where the F-111 went down. Eighteen of the fighters had taken off from England for the 2,800-mile journey to the shores of Libya. All the rest returned safely, although one plane had trouble and made an emergency landing in Spain.

The search for Ribas Dominicci and Capt. Paul Lorence of San Francisco, the weapons systems officer, was called off Wednesday.

A note hand-delivered to the family by an Air Force official said Ribas Dominicci had been lost in action in the raid early Tuesday. ''Our parents are very sad, but thanks be to God, they received the news with a strong spirit,'' Carlos said.

On Thursday, Air Force spokesman Capt. Miles Wiley said in Washington that the Defense Department considered Ribas Dominicci to have been killed in action. He said the pilot was selected recently for promotion to major.

The family has refused to schedule a funeral service, Carlos said, hoping that his brother still might be found alive.

''They haven't found the plane yet. Who can say?'' he said. ''There's always hope.''

Fernando Ribas Dominicci grew up in Utuado, a mountain town about 40 miles northwest of San Juan where his father and mother have a furniture store.

He and his wife Blanca Linda lived for the last several years at the Royal Air Force Lakenheath base in England, where his squadron was based. They have a 4-year-old son, Fernando Luis.

He is the youngest of six brothers.

Ribas Dominicci was one of 225 Puerto Rican officers in the Air Force, according to Pentagon figures.