FRANKFURT, West Germany (AP) _ A Frankfurt court today convicted two doctors in the so-called ''mercy killings'' of more than 15,000 physically handicapped and mentally retarded people under Adolf Hitler's Nazi regime.

Aquilin Ulrich, 73, and Heinrich Bunke, 72, were convicted on accessory to murder charges and sentenced to four years imprisonment each for their roles in the killings.

Their trial lasted 15 months and was one of the last major Nazi war crimes trials in West Germany.

Ulrich was found guilty of helping put to death at least 4,500 patients during the so-called ''Euthanasia Action'' carried out by the Nazis in 1940 and 1941.

Bunke was convicted in the deaths of at least 11,000 people during the same period.

The two doctors argued during their trial that they had to kill the handicapped people because they were under orders.

Both doctors served at the Brandenburg and Grafeneck camps, where thousands of handicapped people, mostly mental patients, were gassed.

The Nazis claimed their ''euthanasia'' program was designed to help hopelessly ill patients with no hope of recovery.

The two doctors, who both practiced gynecology after World War II, first went on trial in the 1960s but were freed when the court ruled they were forced by the Nazis to take part in the mercy killings and acted under orders.

The West German Supreme Court overturned the ruling in 1970 and ordered a retrial, which was delayed for years by the ill health of both doctors.

Ulrich practiced in the southern city of Stuttgart after World War II. Bunke worked in the northeastern town of Celle.