In 1963, writing from a jail cell here, Martin Luther King Jr. called this industrial city "the most thoroughly segregated in the United States." Now, 20 years later, Birmingham, unlike some northern cities, is on the brink of being released from a school desegregation plan imposed by a federal judge because it will have met its integration goals.

By most accounts, the person primarily responsible for the schools' progress during the last 10 years is Wilmer S. Cody, Birmingham's 46-year-old superintendent of schools, who is the leading contender to be the next school chief in Montgomery County, Md.

Cody, a white man educated in segregated schools and now running a 78 percent black school sytem, is likely to be offered the Washington area job next week if Cody's meetings today in Montgomery with school and community leaders proceed without controversy.

Unlike Birmingham, Montgomery County has never been under a federal court order to desegregate its schools. But during the last decade the suburban county has witnessed a dramatic increase in the number of minority students, especially in the lower part of the county. How Montgomery's newly elected board majority deals with urbanization of a once overwhelmingly white and affluent school system has been a question largely unresolved but constantly debated in recent years.

"Will the board operate a single school system . . . or will be there one for the down-county area, for the black and the poor, and one for the schools north of the beltway?" board president Blair Ewing asked his colleagues at a recent school board meeting.

Cody is also a candidate for superintendent in Baltimore city, but he said he will take the Montgomery job if it is offered.

In what a leading national educator calls one of the toughest superintendent's jobs in the nation, Cody was credited with leading the Birmingham school system through a racially troubled period without the violence that marked other southern schools. He also was praised for creating a progressive educational program with stiff standards out of an an educationally backward system that had no central curriculum or guiding plan when he arrived.

Under Cody's leadership, the Birmingham schools, with a budget one-fifth the size of Montgomery's to provide for half the number of students, raised test scores significantly; got accreditation for its elementary schools; started kindergartens; won the first successful property tax increase for schools in half a century; closed schools for the handicapped and mainstreamed those students into regular schools; required elementary pupils to pass promotion tests; increased high school requirements; and eliminated all totally white schools without the involuntary busing of any student outside his or her neighborhood.

Cody also integrated his staff: Three of his five assistant superintendents are black, and teachers of both races are divided evenly among all schools.

Both his supporters and detractors attribute Cody's successes to a low-key negotiating style based on long-term planning. Cody is a man serious and broad about his convictions, but undramatic in their implementation. In three days of interviewing, not one person closely associated with Cody's work here could recall a particular speech that they would describe as inspirational or an event in which he called upon his colleagues or the public to rely on some sort of moral judgment.

Instead, Cody, a Harvard-educated administrator who began his career as an elementary school teacher in his native Mobile, Ala., was repeatedly described as a methodical yet visionary man who has a plan and list of goals for nearly everything he does. Within months after arriving here, Cody released "An Agenda for Birmingham Schools," a blueprint for what he thought the system needed and what steps should be taken to achieve them. Nearly every one of those goals is included in the list of accomplishments above.

Although he is often described as unforceful and willing to compromise, Cody has been intransigent on what he considers matters of principle. Last year, Cody's nomination by U.S. Department of Education Secretary Terrel Bell to head up the National Institute of Education was reportedly rejected by the Reagan administration after he criticized federal cuts in education programs.

Another time, when a well-connected white teacher attempted to bring political pressure to bear on Cody to block her transfer to a predominantly black school, Cody gave the woman a public hearing and then transferred her to the school.

"You need to picture what Bill Cody walked into," said Louis Dale, president of the five-member appointed school board and chairman of the math department at the University of Alabama at Birmingham. "The city government at one time had turned police dogs on demonstrators. Martin Luther King was jailed here. The Klan was here. Whites were leaving the city and even though the court order to desegregate the schools had come down 10 years earlier, for all intents and purposes, the schools still were segregated.

"We had all this turmoil in the streets but somehow Cody managed to keep it from spreading into the schools," Dale said. "He did it by being strong and low-key. He was committed, but he was patient. He was quiet, but he was a fighter. He knew how far he could take the school system, but he also had the perception to know what he could and could not do. And, somehow through it all he made this school system, one that had nothing, a progressive one. It still amazes me. He is probably the most respected white man in the black community."

Sitting in his sparsely decorated wood-paneled office here last week, Cody, the son of a tool-and-die maker, educated in Mobile's segregated schools, said his desegregation plans were born simply out of a belief in fairness.

The desegregation plans negotiated by Cody involved voluntary programs--magnet schools offering special classes, and pairing predominantly black ones with predominantly white oness. Although white enrollment has continued to decline since desegregation began 20 years ago--from 40.1 percent in 1973 to 22 percent this year--much of that decline occurred before Cody's arrival. Only 80 white elementary school students left the system this year compared with 798 two years ago.

During the latest go-round over Birmingham's desegregation plan two years ago, Cody persuaded the Justice Department to drop a plan that would have bused 3,800 students and instead try his academic programs to alter racial enrollments.

Cody avoided being the point man of disgruntled whites by negotiating plans that did not involve forced busing. Some white residents, however, contend that more white students might have remained if Cody had been more resistant to the U.S. Department of Justice.

"He made a plan and just handed it to people," said Russ Vann, chairman of Citizens for Responsible Education, which once attempted to block renewal of Cody's contract. "No one argues that segregation is wrong, but we think schools have gone down in caliber since Cody's plans have gone into effect."

Others, however, argue that both white students and black students would have been worse off if Cody had attempted to fight the courts.

"There isn't a person in this city who could stop one soul from leaving the school system after they were desegregated," said Odessa Woolfolk, director of the Center for Urban Affairs. "If Cody had gone along with these people, we'd be busing students."

Although proud of his desegregation accomplishments, Cody, who supervised a voluntary desegregation program as superintendent of Chapel Hill (N.C.) schools before coming here, said he would prefer to be remembered for influencing the way students think.

"I would like to think that my legacy here will be that all students are being taught and learning more today than they were when I first came here," he said, pointing to test scores that have shown a continuous increase. As an example, Cody said that in 1975, eighth graders were scoring nine months below the national average in math; last year, they were three months above the average.

But Cody will leave behind some critics within the system.

"My experience was very negative," said one former teacher, who quit during Cody's tenure. "I do not know how much relates to Wilmer Cody . . . . But it is a demoralizing situation that doesn't encourage exploration; most of the problem probably is money. There was never enough to do anything . . . . So much time is spent on remedial learning that the more able students are neglected."

Cody said the test scores don't support the former teacher's observations that better prepared students are suffering in the Birmingham schools. The percentage of students reaching the top quarter of national test scores has increased steadily, he said. In 1976 only 7 percent of eighth graders were scoring in the top quarter; last year 20 percent did.