Defense Secretary Dick Cheney told Panamanian leader Guillermo Endara this week that the United States will remove its troops by the end of the decade as stipulated in the 1977 Panama Canal Treaties.

''The secretary of defense indicated that, in line with the treaties, the orderly withdrawal of U.S. troops would proceed," the Panamanian government said in a statement after a 20-minute meeting between Mr. Endara and Mr. Cheney Tuesday.Mr. Cheney's visit to Panama, his first since December 1989 when U.S. troops ousted former strongman Manuel Noriega, was part of an extensive Latin American tour that will also take him to Brazil, Argentina and Chile.

Under the canal treaties, the United States must withdraw all of its 10,000 troops from the country by the end of 1999. The Pentagon plans to remove half that number by 1996 as part of a gradual pullout.

"We're moving forward with implementation of the Panama Canal Treaties as negotiated. The process is moving forward," Mr. Cheney said.

He said there were no plans to accelerate the removal despite major defense budget cuts over the next five years.

Mr. Cheney said he and Mr. Endara were also to "talk about our counter- narcotics efforts, which are important regionwide but a special focus in Panama and Guatemala."

Panama and Guatemala are considered major transshipment points for South American cocaine bound for the United States and Europe.

Critics of the Endara government charge that more cocaine is moving through Panama now then under Noriega, who is on trial in Miami on drug charges. But Panamanian officials claim they have been seizing more cocaine year after year.

During his 2 1/2-hour visit to Panama, Mr. Cheney also met with Gen. George Joulwan, commander of the Panama-based U.S. Southern Command, which oversees all U.S. military operations in Central and South America.

Mr. Cheney, on one of the most extensive trips ever by a defense secretary to Latin America, is scheduled to be in Buenos Aires today and Santiago Friday.

He plans to return to Panama Monday before flying back to Washington.