For almost six months, Maryland Gov. Harry Hughes was riding the crest, playing the role of statesman while moving unimpeded toward an easy nomination and second term.

Until Wednesday.

On that humid summer day, two things Hughes had hoped would not happen did happen. First, Baltimore's popular Democratic mayor, William Donald Schaefer, emphasized his frosty relationship with the governor by making a flamboyant appearance at the opening of Republican Robert A. Pascal's Baltimore headquarters. In his own duck-the-direct-question way, Schaefer indicated that he preferred Pascal to Hughes.

Eight hours later, Lt. Gov. Samuel W. Bogley, who Hughes had dumped from his ticket with the hope that he would slip quietly into oblivion, refused to do so. Literally and figuratively, Bogley joined hands with Harry J. McGuirk, signing onto the 58-year-old Baltimore senator's ticket as a candidate for re-election as lieutenant governor. Bogley's decison stilled rumors that McGuirk might abandon his primary challenge to Hughes.

Suddenly, the longshot McGuirk candidacy, bolstered by Bogley's vote-getting popularity among antiabortionists and his in-laws' substantial financial resources, appeared credible. Suddenly also, Pascal's floundering campaign, with the tentative nod of Baltimore's popular mayor, received a boost that could play an important role in the election's outcome.

If the Hughes campaign was going to become vulnerable, Wednesday was the day it would begin.

"It's not going to be a free ride for Harry as everyone has expected," said Del. Timothy F. Maloney (D-Prince George's). "He's going to have to hustle to beat McGuirk or to get him out of the race. And the presumption of the general (election) that no Republican can win in Baltimore is out the window if Schaefer's going to anoint Pascal as a McKeldin-like Republican," referring to former mayor and governor Theodore McKeldin.

Hughes, at his biweekly press conference today, still exhibited the confidence of an incumbent with a large lead in all polls. But while the governor was hoping to discuss his administration's latest achievement -- new federal funds to clean up a hazardous waste site -- he instead was besieged with questions about the events of Wednesday.

"Governor," came the first question, "how do you feel about Mr. Bogley's announcement last night that he's joining Sen. McGuirk's ticket?"

For the next 30 minutes, Hughes conceded that Wednesday's events may make the Sept. 14 Democratic primary and the Nov. 2 general election a more substantial contest than anyone had expected.

Hughes, typically understated, minimized the effect of the Democratic mayor's appearance at Pascal headquarters, saying it was normal for Schaefer to drop in on Pascal campaign events because the two men are friends. Hughes added, however, that he expects Schaefer, as a Democrat, to support his party's nominee after the primary -- "and I expect to be that Democratic nominee."

Hughes, like Pascal, understands that Baltimore is the key to winning in Democratic Maryland. Conventional wisdom holds that for a Republican to win, he must get 40 percent of the votes in the city, where close to 20 percent of the state's vote was cast in the 1980 presidential election.

As a result, Pascal has campaigned on Schaefer's coattails throughout the state but Wednesday was the first time since Pascal's December fund-raiser that Schaefer has given any indication that he may be willing to help his friend.

It was the Bogley matter that appeared to hold more significance for Hughes.

"I was hoping Mr. Bogley would continue in state government," said Hughes wryly, "but this isn't what I had in mind."

Hughes said he would have preferred hearing directly from Bogley about his decision to run on an opposing ticket -- instead of from an aide -- but that he does not begrudge Bogley his decision.

"I don't feel betrayed," Hughes said. "But I do feel that Mr. Bogley could have sat down and talked to me about that situation, which he did not. But in politics, if you start worrying about being betrayed, you aren't going to have such a pleasant life."

He also parried back at Bogley, a former Prince George's County Council member who had suggested that with State Sen. J. Joseph Curran Jr. replacing him as lieutenant governor, the Hughes-Curran ticket lacked geographical balance, because both men are identified with Baltimore, even though Hughes originally was from the Eastern Shore.

"You can only have one lieutenant governor on the ticket, you can't have one from each section of the state," Hughes said. "I do think we've progressed far enough in that state to get away from thinking that parochially. I'm governor of the whole state. I think I can represent southern Maryland, western Maryland, Baltimore city and the rest of the state. I had hoped we had gotten beyond that kind of provincial thinking."

Hughes also challenged Bogley's claim that Hughes had been a bad partner because Bogley had been given little to do as lieutenant governor after the two men fell out over Bogley's strong antiabortion views. "I don't think I've been a bad partner," Hughes said. "He's had a free hand in performing that role. If there were other functions he desired to perform, he only had to say so. My door was always open to him. It was open for any staff meetings that went on in there. There was always an open door for the lieutenant governor."

Bogley 40, never felt that way. He talked openly about his limited role in the administration and even publicly questioned whether he was worth the $52,000 annual salary.

While Bogley's Annapolis persona has been that of an outcast, the unintentional mascot of the Hughes administration, a man given whistling standing ovations by legislators simply to embarrass Hughes, his record as a candidate is impressive.

He was elected twice to the county council and he was a part of the Hughes upset in 1978. And he brought along two of the reasons he was tapped by the impoverished Hughes campaign four years ago -- the backing of abortion foes and the publishing money of his in-laws, the conservative Bradys of Bowie.

One Bogley associate, talking about the McGuirk-Bogley ticket, said, "I think that the Brady money was part of the package. They have some reason to defeat Harry Hughes. They think Sam was treated pretty shabbily. McGuirk and the Bradys in combination can raise a pretty good campaign war chest."

McGuirk said he has about $250,000 in pledges and hopes to raise another $100,000 at a $100-a-ticket fund-raiser at the end of the month. His first media blitz, $40,000 worth of radio time, was designed to bring name recognition to his candidacy.

Hughes, as an incumbent, is expected to raise in excess of $1 million.

McGuirk hopes his selection of Bogley will quiet speculation that his candidacy is a front for one of the hidden agendas he has become famous for during his 22 years as a legislator. Even his new running mate is aware of the fact that 19 days before the deadline, McGuirk has not filed. The Hughes people maintain the possiblity that McGuirk might back out and strand Bogley, who cannot run for lieutenant governor without a governor.

For that reason, Bogley's backers have filed a "Friends of Sam Bogley Committee," leaving him available to become a last-minute candidate for county executive or any other state or local race.