The University of the District of Columbia has witheld $4,800 in salary and started dismissal proceedings against Prof. David L. Lewis, a historian with a national reputation who has written a widely praised biography of the Rev. Martin Luther King Jr.

In a letter to Lewis, university vice president William Moore Jr. said Lewis had canceled all four courses he taught in April without permission.

Moore said Lewis also had failed to attend history department meetings or maintain office hours during April for students to meet with him.

"You have deprived university students of their contracted right to class instruction," Moore said. "Your actions have resulted in student complaints [and] have jeopardized the University's reputation . . ."

Lewis acknowledged canceling the classes, but he said attendance had been so small - ranging from just two to 12 students - that he had been able to cover all necessary text material during the first two months of the three-month semester. He said he believed it would be "more productive" to replace the last four weeks of classes with term paper and reading assignments, and said students agreed with the arrangement.

Lewis said that he spent much of his time in April finishing the manuscript of a book about the Harlem Renaissance, a literary and aritistic flowering in the 1920s and 1930s. The book is being published by Alfred Knopf.

He said the publisher expected the manuscript around the end of April, but Lewis strongly denied that he canceled classes to work on the book. He said he remained in contact with many of his 30 students by telephone.

He said he felt the charges against him, which were originally filed by history department chairman Ali Bakri, were the result of a longstanding feud in the department, most of whose members used to teach together at Federal City College.

Lewis, 43, holds a bachelor's degree from Fisk University, a master's from Columbia and a doctorate from the London School of Economics. He began teaching at Federal City College in 1970. The college was merged with two other public colleges in 1977 to form the University of D.C.

"There's been trouble in that department for a long time," Lewis said. "It pays well, but you don't have to write, and you don't have to teach well . . . When you have people who do write books and they're recognized, there can be a lot of trouble for people who don't do much . . . I've always stuck my neck out. Now they're trying to make (the history department) a closed corporation where professional recognition is a no-no."

Lewis said he told Bakri on April 3 that he was canceling his classes, and that Bakri expressed no objection. Bakri also signed a time sheet, certifying that Lewis had carried out his duties during the first half of April, Lewis said.

Bakri, who is an associate professor as well as history department chairman, siad he recommended the action against Lewis because of Lewis' "unprofessional behavior."

"That's all there is to it," Bakri said in an interview. "There's nothing else."

John D. Butler, dean of the College of Liberal and Fine Arts, who reviewed Bakri's recommendation, declined to say what his position was in the case, but he said:

"Just because someone is eminent, does that excuse him from his contractual obligation to teach classes?"

Besides his biography of King, which has sold 50,000 copies since 1970, Lewis has written books about the history of the District of Columbia and the Dreyfus Affair in turn-of-the-century France.

In interviews yesterday, Lewis was warmly praised by historians John Hope Franklin of the University of Chicago and David H. Donald of Harvard.

"Lewis has written the best biography of Martin Luther King that there is," Franklin said. "He's a first-rate historian. I'm shocked this is happening to him. He would be a star at any university."

In a letter dated May 17, UDC vice president Moore told Lewis, "it is the intent of the university" to dismiss him after at least 30 days. He said Lewis could ask for hearing by a special faculty committee.

Yesterday Lewis and his attorney, Sol. Z. Rosen, asked D. C. Superior Court Judge Tim Murphy to cancel the dismissal notice and order the university to give Lewis the pay that was withheld since mid-April. Lewis' annual salary is $32,000.

Murphy denied the motion for a temporary restraining order on the ground that Lewis should go through all university administrative procedures before a court could intervene.