Lt. Gen. Frank E. Petersen Jr., Marine commander at Quantico in the Marine Corps Museum on June 17, 1988. (Frank Johnston/The Washington Post)

Frank E. Petersen Jr., who became the first black Marine Corps pilot and general officer, took the Navy’s entrance exam in 1950. The questions, he later recalled, were “relatively unremarkable.”

The petty officer third class overseeing the test called him a few days later, asking, “Would you mind retaking the examination?”

It was not hard for the future three-star general to decode the reason for the request: His score was high, and the implication was that he had cheated. Again, he aced the test, and the petty officer exclaimed: “Petersen, my boy, the Navy has opportunities for guys like you. . . . My, God, man, what a great steward you’d make!”

The remark was particularly painful for Gen. Petersen, who said he had turned to the military because he hoped it would an escape from pervasive racial prejudice in his native Kansas.

Gen. Petersen, who died Aug. 25 at 83, joined the Navy in June 1950 as a seaman apprentice and the next year entered the Naval Aviation Cadet Program. He was motivated by the recent Korean War combat death of Jesse Brown, the Navy’s first black aviator.

Gen. Louis H. Wilson Jr., left, commandant of the Marine Corps, pins the brigadier general star on the shoulders of the first black general in the Marine Corps, Frank E. Petersen Jr., on April 27, 1979. Also pictured is Alicia Petersen, wife of Gen. Petersen. (Margaret Thomas/The Washington Post)

“Quite frankly, I didn’t even know blacks were allowed into the program,” he later said.

President Harry S. Truman had ordered the armed forces to desegregate in 1948, but Gen. Petersen later wrote that the Navy and Marine Corps were “the last to even entertain the idea of integrating their forces.” And whenever he left the flight training base in Pensacola, Fla., he was subjected to the indignities of the Jim Crow South.

Bus drivers ordered him to the back of the coach, and he was barred from sitting with white cadets in restaurants and movie theaters. He largely swallowed the treatment, he later told The Washington Post, because he could not fight two battles at once. “I knew that I couldn’t win if I were to tackle that, as opposed to getting my wings,” he said.

One instructor tried to minimize his performance in the air — giving him lackluster ratings — but he said white peers came to his defense. Upon completion of his flight training, he was commissioned a second lieutenant in the Marine Corps. He flew 64 combat missions in Korea in 1953 and earned the Distinguished Flying Cross, among other decorations.

In 1968, he did a tour of duty in Vietnam, where he commanded a tactical air squadron and served in more than 250 missions. He received the Purple Heart for wounds suffered when he ejected after his plane was struck by anti-aircraft fire over the demilitarized zone.

In all, he accumulated more than 4,000 hours in fighter and attack aircraft. In the early 1970s, he took administrative jobs and began his rapid ascent through the ranks, working to recruit more black officers and holding a command post at Marine Corps Air Station Cherry Point, N.C.

In 1979, he was promoted to brigadier general and was named the NAACP’s man of the year. He became a lieutenant general in 1986 and spent the next two years as commanding general of the Combat Development Command at Quantico, Va.

At Quantico, he oversaw 7,010 military personnel and 5,930 civilians, but he drew wider media attention as the convening authority for two highly publicized trials. One was the case of Sgt. Clayton Lonetree, who was convicted in 1987 of passing secrets to Soviet agents.

In the second matter, Gen. Petersen cited new, exculpatory evidence in his decision to convene a second court-martial of Lindsey Scott, a black Marine corporal who had been convicted by a military court in 1983 of having raped and attempting to murder a white woman. The highest military court overturned the initial decision, citing an inadequate defense, and Scott was acquitted in 1988.

The cases, Gen. Petersen told The Post, had been “very emotional and very difficult.” He soon retired from active duty, after receiving the Distinguished Service Medal for exceptionally meritorious service, and spent many years in charge of corporate aviation for the Delaware-based chemical giant DuPont.

Frank Emmanuel Petersen Jr. was born in Topeka, Kan., on March 2, 1932. His father, a native of St. Croix in the U.S. Virgin Islands, owned a radio repair shop. The younger Petersen grew up enthralled with flight, watching B-29 bombers take off at a nearby air field during World War II.

While in the Marines, he received a bachelor’s degree in 1967 and a master’s degree in international affairs in 1973, both from George Washington University. He graduated from the National War College in 1973.

His marriages to Eleanor Burton, Alicia Downes and Jonnie Robinson ended in divorce. Last year, he remarried Downes.

Besides his wife, of Stevensville, Md., and Washington, survivors include four children from his first marriage, Dana Moore of Baltimore, Lindsay Pulliam of Alexandria, Va., and Gayle Petersen and Frank Petersen III, both of Washington; a stepdaughter he adopted, Monique Petersen of Washington; a brother; a sister; four grandchildren; and five great-grandchildren.

Gen. Petersen died at his home in Stevensville, on Maryland’s Eastern Shore. The cause was complications from lung cancer, said Dana Moore.

Late in his career and in retirement, the general often was asked about progress on race relations in the armed forces and society at large.

He recalled the years after his return from Korea, when he continued to face vicious discrimination. He said he wore his uniform everywhere, figuring that if anyone attacked him, it would be a federal offense.

Tensions exploded during the Vietnam War, when strife over perceived racism in assignments, military justice and promotion at times seemed to threaten the military’s ability to carry out its missions.

“Platoons that were 80 percent minority were being led by lieutenants from Yale who had never dealt with ghetto blacks,” he told The Post in 1990. “Soldiers were angry. Martin Luther King was killed. It all came together. It was a mess.”

He said he once encountered a cadre of eight black dissidents who felt so mistreated — and their chance of being killed in Vietnam so high — that they threatened to assassinate a white military official.

Gen. Petersen said he defused the situation by asking who among the eight would volunteer to pull the trigger; no one raised a hand. He reported the plot and was named a special assistant on race relations to the Marine Corps commandant.

Citing Marine figures, The Post reported in 1988 that there were 195,719 Marines, 36,882 of whom were black. Of 20,163 officers, 960 were black. At present, there are 184,355 active duty Marines, of whom 19,017 are black. There are 20,924 officers, of whom 1,115 are black.

For years, Gen. Petersen was the Marine Corps’s only black active-duty general. He chronicled his struggles in a memoir, “Into the Tiger’s Jaw” (1998), written with J. Alfred Phelps.

In 1988, The Post asked Gen. Petersen if his military career had real impact for African Americans.

“As much as I would like to philosophize and say that it hasn’t,” he said, “it has made a difference.”