Dan Hoehne, a U.S. Park Police officer, led his horse triumphantly from the muddy obstacle course at the Prince George's Equestrian Center, a course designed to make the most tranquil animal kick, jump and just plain refuse to cooperate with its rider.

Hoehne's horse Guy had made the best showing of the first six entrants, standing quietly nose-to-nose with angry demonstrators carrying signs that read "No More Flies," walking steadily among balloon-carrying children and keeping calm while a nearby foot patrolman fired six shots from his handgun.

"We do this a lot" during training, said Hoehne, whose job with the Park Police is to train horses, some that eventually end up with U.S. Secret Service agents who ride with President Reagan.

"But most horses we get haven't seen obstacles like these." For example, he added, their training does not include work with guns.

Hoehne and 39 other mounted officers competed yesterday in the second Police Equestrian Competition in Upper Marlboro. Winners receive ribbons, typical of prizes at many horse shows.

The competition is divided into two classes: equitation, in which mainly the riders are judged, and police obstacles, in which the horses are the focus.

"What this is," said Michael Wynnyk of the Maryland-National Capital Park Police, "is a good motivating factor to push horses to the extreme. And we think it makes for a better officer."

Participants came from police departments in Prince George's and Montgomery counties; Baltimore; Philadelphia; Wilmington, Del.; U.S. Park Police; Secret Service, and the Maryland-National Capital Park Police.

For the officers, there was more to the event than just winning. It provides an opportunity to discuss their shrinking ranks. The numbers of mounted officers generally has dwindled for many city departments. In Wilmington, for example, there were 22 of them in 1977. The department now has seven.

Charles Steward, one of Wilmington's mounted officers, said his small group is much like a fraternity within the department. It's much the same, he said, among all mounted police.

"We haven't taken an oath yet," Steward said. "But our numbers are getting smaller. This competition gives us a chance to get together and see what everyone is doing."

But Steward said he doesn't think mounted police are headed for extinction. In fact, he believes the opposite. "The public loves us, and they dictate what the department does. I think our numbers will go up as soon as the politicians wise the heck up."

The officers, who made up most of the spectators at yesterday's competition, cheered a good showing, whether it came from one of their own group or their rivals. Hoehne and his horse, for example, got a round of applause even though Guy refused to cross the first obstacle, a small bridge surrounded by flapping foil. He placed two hoofs on it but backed away when a breeze made the flapping noise grow louder.

"Show me a bridge anywhere in this country that's covered with foil," Hoehne said to Wynnyk after his run.

Deadpanned Wynnyk: "It's new. It's coming up a lot out in the country."

A few contestants later, the bridge was crossed. First, by a Secret Service horse. Second, by a Secret Service horse. Third, by last year's winners, Fred Yeager and Camelot from Philadelphia. Fourth, by a Secret Service horse.

What makes Secret Service horses so fearless? "They're just good. They'd better be," Hoehne said.

In the end, it was a Secret Service horse, N-Advance, ridden by Officer Barbara Riggs, which won the police obstacle portion of the competition. Glenn Jones of the Prince George's County Police, riding Cappy, took first place in the equitation category.