AYER, Mass. (AP) _ ''Taps'' was played and a U.S. color guard fired a rifle salute to honor the memory of 22 World War II prisoners of war who died and were buried at an Army base where nearly 5,000 POWs were held four decades ago.

''The bonds of human beings are stronger than the lines that divide enemies,'' West German Consul General Jurgen Kalkbrenner said during the annual memorial Friday for World War II casualties and POWs who died at Fort Devens.

About 100 soldiers and civilians watched as ''Taps'' played and the honor guard fired three volleys. Kalkbrenner and Italian Consul General Chancellor Tonino DeMusis, both based in Boston, placed two wreaths by the marble rows of grave markers.

''The strength of NATO is a tribute to the ability of men to settle their differences,'' said DeMusis.

From February 1944 to mid-1946, about 4,500 German and 450 Italian servicemen were prisoners at Fort Devens, northwest of Boston near the New Hampshire line. The base, still an active Army post, was one of nearly 250 U.S. POW camps which held more than 450,000 POWs during the war.

''I don't think it was really that bad for those sent here. They have said it was better than the camps in Europe,'' said Fort Devens spokesman John Rasmuson.

Many of the POWs, captured mostly in North Africa and Sicily, enjoyed relative freedom and tranquility behind the barbed wire at Fort Devens, according to Rasmuson.

They organized a theater group and formed a soccer club that played against U.S. servicemen. Small newspapers were published in Italian and German, detailing stories from other prisoners and camp gossip.

Stark visions of imprisonment and warfare survive in the form of 10 large paintings, which Rasmuson said are believed to be the work of a former POW. Surrealistic, disjointed images stare down from the walls of a Devens warehouse.

The prisoners worked in the base laundry or filled jobs left by local men fighting overseas, such as picking apples and cutting timber. They were paid 80 cents a day.

A few trysts with local women prompted some unsuccessful escape attempts, but camp life was generally routine, said Rasmuson.

Nineteen of the Germans and the two Italians buried here succumbed to illness, said Rasmuson. The notable exception was U-boat captain Friedrich Steinhoff.

Steinhoff shot himself to death in May 1945 after being ordered to surrender his vessel off Portsmouth, N.H., Rasmuson said. Steinhoff's body was shipped to Fort Devens.

Steinhoff had worked closely with German rocket expert Wernher Von Braun on Adolf Hitler's plan to build underwater V-2 missile launch sites in the English Channel, Rasmuson said.

Occasionally a former POW returns, he said.

Last July, former Austrian Army POW Walter Meierson toured Fort Devens, and recalled repairing U.S. Army gas masks and sewing patches on American uniforms.

He remembered the German surrender in 1945 because all but staple foods were taken from the shelves of the POW canteen. ''They went from being prisoners to the vanquished,'' said Rasmuson.

''I think the ceremony is a good way to settle the past disgreements,'' said U.S. Navy veteran Edward Jastrab, 71, of nearby Pepperell, who attended Friday's memorial.

''Besides,'' he said, ''I'm going to join them. I have a plot waiting for me in the cemetery.''