Robert Nye spread his collection of letters spanning almost four decades across a table on the back porch of his daughter's Rockville home. He hadn't seen the man who wrote them, a Japanese prisoner of war under his command, for 40 years.

But yesterday, Nye, 70, a World War II veteran who now lives in North Olmstead, Ohio, was reunited with 67-year-old Shigeru Takagi, of Tokyo, who saved money for a year to bring his wife to America for a visit with Nye.

The men shook hands on the front steps of the two-story brick home yesterday morning. There were plenty of smiles, gifts and stories exchanged between Takagi, a frail mustachioed man, who works as a bookkeeper for a wedding dress factory, and Nye, who sells real estate. Nye gave Takagi a bottle of Scotch. Takagi gave Nye a shirt.

"How are you doing? You haven't gotten any bigger. You're supposed to grow. Look at me," Nye said, referring to his own girth while his friend nodded and laughed.

Nye and Takagi met for the first time after the war in November, 1945, when Nye, an Army sergeant, went to the Philippine island of Mindanao. He expected to be sent home from there but instead found himself in charge of 600 Japanese POWs for two weeks on an island where 27,000 prisoners were being held in camps.

Over a period of two months, eight sergeants commanded the camp, Takagi recalled. "He was the best one, and I didn't forget Mr. Nye. When I came back to Japan, I write letters to him saying many thanks."

Nye said he befriended the prisoners by supplementing their standard food rations with rice he acquired from the Army.

"They were begging for rice and after they got it, they pretty much thought I was God," Nye said. At the camp, they talked about their homes and played cards. But Nye never expected to maintain a relationship with Takagi after they went home.

"We were never really buddy-buddy," he said. "But he initiated the writing, and I picked it up."

The men have exchanged family pictures and written about two letters a year. "I have to admire Takagi," Nye said. "He gets out a dictionary and studies like hell to get his phrases down in his letters. They don't always come out right. But I understand what he means." Nye, who speaks no Japanese, writes Takagi in English as well.

Takagi and his wife flew to Baltimore to visit relatives and drove to Rockville yesterday to see Nye, who came 360 miles from Ohio to reunite with his old friend. Linda Rathbun, Nye's 38-year-old daughter, and Takagi's daughter have also been corresponding for 25 years.

On torn and yellowed notepad paper, Takagi, a first sergeant in the Japanese army, wrote his first letter to Nye in 1948. He apologized for not writing sooner, then noted that " for about two weeks you were in charge of us Japanese P.W . . . . Now I thank you for your kindness during that time. I remember many kindness for us from you and I studied real democracy."

He will stay with Nye for two days but has no plans for sightseeing.

"The only sight I came to see is him," Takagi said pointing across a table to his friend.