There were flowers, balloons and speeches. The years-long journey to find a permanent home for its Annapolis campus seemed finally to be over for Sojourner-Douglass College last week as it celebrated the grand opening of its $2.5 million Edgewater building south of the city.

But just days later, the Maryland Court of Special Appeals issued a ruling that threatens to undo the project, potentially forcing the college to tear down the 16,000-square-foot building. A three-member panel said the building violated a restrictive covenant that required the property to remain undeveloped except for "educational facilities in conjunction with the Anne Arundel County Board of Education."

The ruling overturned a Circuit Court ruling and marked a victory for neighborhood residents who opposed the location of the predominantly black college in a fight that supporters of the campus say has been tinged with racial overtones. Opponents say that has not been the case.

The lower court ruled last year that the development did not violate the restriction because the college had an agreement with the school board to provide spare classrooms, student teachers and other educational resources. But because the school board was not involved in the actual planning and development of the building, the appeals panel ruled July 21 that the board "played no role in the development of the . . . college facilities."

"That the [school] board might, at some future time, conduct meetings or classes in the college's buildings, or might engage college students as student teachers or aides, falls far short of substantial evidence that the proposed development is 'for educational facilities in conjunction with the board,' " Judge J. Frederick Sharer wrote.

The ruling's full impact will not be known until the panel issues a follow-up mandate, expected sometime in the next 30 days, explaining how the decision will go into effect.

The case probably will be sent back to the Circuit Court to determine a remedy, including possibly tearing down the building, attorneys on both sides said.

The college is expected to appeal the ruling to the Maryland Court of Appeals, the state's highest court.

"Obviously the court adapted the plaintiff's interpretation of the covenant, which we disagree with and which the Circuit Court disagreed with," said attorney James Praley, who represents the college.

Charlestine Fairley, director of the Annapolis campus, did not return phone calls yesterday.

The college, named for abolitionists Sojourner Truth and Frederick Douglass, was established in Baltimore in the 1970s as a night and weekend alternative for working students to continue their educations. The college has about 1,200 students at five campuses in Maryland and a campus in the Bahamas.

The Annapolis branch opened in 1993, operating out of two donated rooms in a nonprofit agency. Since then, it has occupied space in a church and a veterinary hospital.

In 2002, it signed a deal with local developer Tom Schubert to build a new campus on six acres his company owned on Stepney's Lane in Edgewater. The new campus would allow the college to serve up to 500 students, more than double its current enrollment.

Almost immediately, some residents raised a litany of objections. Fliers appeared, warning residents about "the alternative school" being considered and asserting that 83 percent of students at an unrelated county alternative school had criminal records, including "sexual offenses, weapons related crimes, drug crimes, assaults."

Supporters of the college suspected the complaints against the college, which serves a predominantly black student body, were rooted in race.

"I think the vast majority of African Americans in the community believe that," said Carl Snowden, an aide to Anne Arundel County Executive Janet S. Owens. "And these beliefs were not formed in a vacuum." Snowden pointed to other incidents in southern Anne Arundel that have made African Americans feel unwelcome, including a 2003 incident in which five students at South River High School were charged with hate crimes.

In 2003, the London Towne Property Owners Association -- made up of some homeowners in the London Town area of Edgewater -- filed a complaint in Circuit Court, saying the development violated a 1988 covenant limiting the land to use for educational purposes in conjunction with public schools.

Attorney Joseph Devlin, who represents the residents, said the issue has never been about race.

"From my clients' perspective, it has always been about the covenants which mandate that the property will remain undeveloped except for one limited exception," Devlin said.