Thirty-one years ago, when a young black lieutenant named Arthur J. Gregg arrived at Fort Lee, Virginia, a segregated Army post in the segregated South, he was not allowed to enter the whites-only officers' club.

Last week, Army Lt. Gen. Arthur J. Gregg, now the highest ranking black officer in the military, attended a luncheon in the same mansion-style officers' club. The occasion was Gregg's retirement after 35 years of service.

And then it was on to the parade grounds, where nearly 1,000 troops gave their final salutes to the man who went from a buck private to three-star general.

During his lengthy career, Gregg was witness to sweeping social changes in the military, particularly in its treatment of minorities. And after watching and participating in many of those changes, Gregg told his friends and fellow officers last week: "I leave feeling good about the Army. It's a great Army."

Gregg began his career as a 17-year-old, $50-a-month buck private in 1946. As a lieutenant general and the Army's deputy chief of staff for logistics, he now makes $50,000 a year and has an office in the Pentagon.

When Gregg first enlisted in the Army, he had no idea he would make a career in the military. As Ivan McEachin, a long-time friend, recalled at last week's Fort Lee luncheon, he and Gregg volunteered together in a "spirit of adventure and a desire to go overseas."

Their first overseas assignments were in Europe, where to their delight, they found an unsegregated society outside the gates of their Army posts in Germany and Italy.

Inside the gates, everything was still as rigidly black and white as it was in America, says Gregg, with blacks working in separate units and spending off-duty time in separate PXs and bowling alleys.

Gregg was trained as a medical lab technician but placed in an all-black military police unit in Germany because Army hospitals there did not allow blacks on their staffs. At the end of their three-year enlistments, Gregg applied to officer candidate school and McEachin left for college. McEachin later returned when jobs were scarce and retired in 1968 as a warrant officer.

In 1950, when Gregg arrived at Fort Lee -- home of the Quartermaster Corps -- he was assigned to a segregated barracks and made to sit in the black section of the post movie theater.

Later that year, when Gregg married, he and his wife Charlene were assigned to segregated housing just outside the post.

"What annoyed me most," said Gregg "was not being permitted in the officers' club."

But soon afterward, conditions began to change in military posts throughout the country. President Harry S. Truman's 1948 order to end segregation and "Jim Crow" practices in the military was beginning to be obeyed, and Gregg says "by the end of the year we were swimming" and eating at the white officers' club.

Despite the official policy of segregation, Gregg said he rarely saw signs of racism in other contacts with his fellow officers.

"We mixed socially with white officers, made many good friends and went to each other's houses for dinner," Gregg said. "I never felt neglected or treated differently by my colleagues. The racism was institutional."

After stints in Korea, Japan and Pittsburg as a supply officer, Gregg returned in late 1958 to a completely different Fort Lee to attend the Quartermaster Corps advanced leadership school. His class of 44 young lieutenants and captains has produced six generals, more than any other class in Fort Lee history, says Maj. Gen. Harry Dukes, a classmate and now Fort Lee's commander.

While the post was integrated, nearby Petersburg, in the heart of a state known for its massive resistance to integration, and had not changed, and the outward signs of racism were still evident: Blacks were unwelcome in many private businesses, and the city was removing chairs and benches from public places to keep blacks out of city parks and libraries.

The military, however, was still working to improve conditions for minority personnel. In the mid-1960s, Gregg said, the military took a major step forward when it began actively encouraging black officers to attend the advanced taining schools that are often crucial to military promotion.

In 1964, after Gregg won honors for running a suply depot battalion in Germany, he was selectedc to attend the Command and General Staff College at Fort Leavenworth, Kansas. In 1967, after winning more plaudits for his command of the Army's largest battalion, 3,500 men at Cam Rahn Bay in Vietman, he was chosen to attend the Army War College at Carlisle Barracks, Penn.

Gregg won his first general's star in 1972 following his consolidation of Army supply depots in Germany and his second star in 1976 after even greater consolidations of armed forces post exchanges and commissaries in Germany, which eliminated 3,000 employes and increased PX sales by almost 50 percent.

The following year he was appointed director of logistics for the Joint Chiefs of Staff and awarded his third star.

His experience supplying troops in Korea, Japan, Germany and Vietnam will be used in civilian service next week, when he joins a new Washington consulting firm, Ferguson, Bryan Associates. Gregg says he will help private companies improve their supply and inventory procedures.

Although Gregg insists the Army has made great strides in recruiting blacks and women, he believes there is still progress to be made.

"I don't think we're doing well enough in the Army," he said, "when only about 7 percent of the officers are black."

As of last fall, according to Pentagon statistics, almost 20 percent of the nation's 2 million officers and enlisted troops were black, compared with about 12 percent of the general population. About one-third of Army personnel is black, with roughly one-fourth of the non-commissioned officers black.

The number of women in the military has jumped from about 45,000 in 1970 to almost 175,000 last fall. Seven of the nation's 1,152 generals are now women. Forty-six of the generals are black and 11 others are listged as Mexican-American or other minorities, according to the Pentagon.

Gregg is the highest ranking of the minority generals at the moment, although there are two other black three-star generals and one Mexican-American. All three won their third stars after Gregg and are stationed outside the Washington area.

The Air Force has 10 minority generals, the Marines one and the Navy three minority admirals, according to the Pentagon. Only one black hs ever reached four-star rank: Air Force Gen. Daniel (Chappie) James, who fought in three wars and died in 1978 shortly after his retirement.

During his Army years, Gregg attended night school, and was graduated summa cum laude with a bachelor's degree in business administration from Saint Benedict College.

After spending most of his life in uniform, Gregg admits he will miss "moving out of the military with the instant recognition of the uniform," expecially his row of silver stars. In four days, Gregg will be just another business suit on downtown Washington streets.

One change Gregg and his wife are enjoying already is their home in Springfield, where they moved several weeks ago. It is the first house they have owned in a career that has required them to live on a dozen military posts around the world. Except for Korea and Vietnam, Gregg has taken his wife and two daughters, Alicia and Sandra, a reporter for The Washington Post, with him to every post.

The Greggs last lived at Fort Myer beside Arlington National Cemetery, where they were attended -- as are all three- and four-star generals -- by an enlisted "aide," or batman, who did everything from mowing the lawn and polishing cars to cleaning uniforms and serving at dinners.

And as Gregg told the Fort Lee troops, "This institution has provided such rich opportunity for my wife and me, far better than anything I ever expected 35 years ago."