HAMBURG, West Germany (AP) _ Britain's Prince Charles and Princess Diana rode in a motorcade through Hamburg today and toured a department store displaying British prodcuts.

The royal couple was greeted at the airport by Mayor Klaus von Dohnanyi and other local officials after a one-hour flight from Munich. They had spent two days of a weeklong West German tour in southern Bavaria.

Charles and Diana also were to meet with members of the British community here and to talk with children from a Sunday school.

They will be guests of honor tonight at a banquet given by Hamburg's Senate.

Bavarian Governor Franz Josef Strauss praised Charles and Diana at a lavish dinner Thursday night, saying their visit has shown Bavaria's undying fondness for royalty.

The royal British couple have been greeted by large, enthusiastic crowds in Bavaria. Britain's royal family traces part of its ancestry to Germany.

''In view of the affection and powerful spiritedness with which our countrymen have greeted you, I must as a democratically elected governor admit to you: In these days the monarchy has once again arisen in Bavaria,'' Strauss told the heir to the British throne and his wife.

Bavaria's last king, Ludwig III, gave up the throne early in this century.

Earlier Thursday, Charles told West German military officers his country's nuclear weapons are committed to the North Atlantic Treaty Organization and to help protect West Germany.

He also flew to a military airport to watch an aerial demonstration of the Tornado jet fighter aircraft, while Diana visited a children's center.