BERLIN — Germany’s highest administrative court ruled on Tuesday that vehicles can be banned from some city streets as part of efforts to improve air quality in urban areas, a decision that could have far-reaching consequences for the country’s automakers and the diesel technology they promoted for decades.

Other European countries have taken measures to reduce the number of diesel-powered cars, but the technology is almost synonymous with Germany, where there are 15 million diesel cars on the streets and where automakers bet their futures on technology they billed as environmentally friendly, even as they rigged software in their cars to pass stringent emissions tests.

Environmental groups welcomed the Federal Administrative Court’s ruling, which was centered on efforts to limit emissions in Stuttgart but set a precedent for all cities in Germany. Although they predicted that bans could be in place in some cities by fall, many cities and automakers pointed to language in the ruling that suggested its ultimate effect was yet to be determined.

The ruling called for “proportionality,” stipulating that only older models with the highest emissions could be subject to such bans and that other considerations had to be taken into account, but automakers warned that allowing individual cities to set their own rules could result in confusion for drivers.