A federal judge on Wednesday dismissed a 17-year lawsuit over the transportation of D.C. special education students, giving the city final approval to control its own school buses and marking a milestone for the D.C. government and Mayor Vincent C. Gray.

U.S. District Judge Paul L. Friedman called it a “historic” day in the class-action suit, which is known as Petties v. District of Columbia. Friedman, who has served as presiding judge in the case since it was filed in 1995, signed an order dismissing the case after a final hearing Wednesday morning.

“We’ve come a really long way,” he said, praising the efforts of State Superintendent Hosanna Mahaley Jones, Chancellor Kaya Henderson, and a host of lawyers and court-appointed special masters who together filed more than 2,000 pleadings in the case.

Gray (D) called the decision “a wonderful affirmation of the progress that we’ve made in getting children with disabilities to school in a responsible and predictable way.”

The District has long struggled to provide basic social services without court supervision. But in the past 18 months, the city has made notable progress in its efforts to get out from under consent-decree requirements — not just in the Petties case, but also in a handful of other class-action suits.

In July 2011, the District won release from a portion of another long-running special education suit after eliminating a huge backlog of due-process hearings. In February, the District settled a nearly four-decade-long suit over its failure to provide adequate mental-health care.

The city is still facing consent decrees in cases that involve the juvenile-justice system, care for people with developmental disabilities and the child-welfare agency.

“We’re making progress,” Gray said of those cases in an interview.

Wednesday’s hearing offered an opportunity for anyone, particularly parents of students with disabilities, to speak out against settling the Petties case. No one opposed the settlement in written or verbal comments to the court.

The original Petties plaintiffs were parents of students with disabilities who had been placed in private schools because of the city’s inability to provide appropriate special-education services in public schools.

They complained that the city’s tuition payments to private schools were chronically late and inaccurate, endangering students’ ability to stay in those schools.

Shortly thereafter, serious concerns emerged about the District’s ability to get students to school safely, reliably and on time. There were not enough bus drivers and attendants, nor enough buses. Students were arriving late to school more than two-thirds of the time.

Since then, with the help of court-appointed special master Elise Baach, the city published payment and rate-setting rules and established a process to resolve payment disputes.

Now, payments are being made on time, Steven Ney, a University Legal Services attorney for the plaintiffs, said in court Wednesday.

Fixing the transportation problems was more difficult, said District lawyer Ellen Efros.

A court-appointed administrator, David Gilmore, oversaw the day-to-day operations of the city’s buses for nearly a decade, repeatedly finding cause to delay transferring the responsibility back to the city. In November, at Gilmore’s recommendation, the court allowed the city to resume control of the bus system.

The city now succeeds in getting 3,200 special education students to school on time more than 94 percent of the time, according to court documents, and absenteeism among bus drivers and attendants is much reduced, with 93 percent of the staff meeting attendance standards.

Ney cited two incidents that have raised concern among parents in recent weeks: a 4-year-old boy who was forgotten aboard a bus for nearly seven hours and a 6-year-old girl who said bus attendants failed to intervene when she was attacked by older students.

Friedman said there will always be such “aberrational incidents” and the question is whether the city has strong enough systems and leaders in place to deal with them swiftly and fairly. Friedman said that the city is “ready to move forward.”

The District’s transportation system is now “in good hands,” he said. “It’s in good shape.”

Ney agreed. The District’s challenge now is to strengthen public schools’ special-education offerings so that fewer students have to be sent far afield to private schools, he said. Only then, he added, will the city reduce the cost and complexity of providing special-education services. The average cost of transporting a student is $26,000 a year, according to court documents.

“The bottom line is that there needs to be more local options for District special-education students,” Ney said.

The mayor has successfully pushed to remove many of the students from their private placements, raising concern among some parents and activists who say the public school system isn’t always equipped to serve them.

Since Gray took office in 2011, the number of students attending private schools at public expense has shrunk by more than a third, falling from 2,204 to 1,407, according to city officials.

Jennifer Jenkins and Magda Jean-Louis contributed to this report.