FREMONT — To discourage motorists from getting off the freeway and clogging city streets just to shave a few minutes off their commutes, Fremont officials have struck a deal with the real-time traffic navigation app Waze that has been directing many of them there in the first place.

As a result, the city’s public works department will impose left- and right-turn restrictions on certain residential streets to make it harder for commuters to hop back onto the freeway. And Waze will factor in those restrictions when it doles out advice on traffic shortcuts.

Noe Veloso, Fremont’s principal transportation engineer, said drivers stuck in gridlock on northbound Interstate 680 headed toward the Tri-Valley have been getting off on Mission Boulevard and, at the advice of Waze and Google Maps, cutting through residential streets to bypass the Mission logjam before hopping back onto the freeway.

The city now intends to alter the flow of some of those streets by making it illegal, for example, to turn back onto Mission from Starr Street during the afternoon commute hours. Such restrictions, combined with the planned activation of highway on-ramp meters, should make commuters think twice before getting off the freeway because they may end up spending more time in traffic.

Another problem area has been the entrance to Niles Canyon Road (State Route 84) at Mission Boulevard, where commuters line up from both north and south to enter the canyon. Some commuters cut through back streets such as Canyon Heights Drive to circumvent much of the Mission Boulevard gridlock and enter the canyon from Old Canyon Road.

Veloso said public works hooked up with Waze in a conference call about three months ago and asked it to consider the effect its algorithms were having on city streets, but the company didn’t budge from its commitment to save drivers time.

Instead, Waze suggested the city participate in its Connected Citizens Program and form a partnership. Under the arrangement, the city would provide data about changes it makes to streets that affect commute times and Waze would take those changes into account when plotting routes for drivers.

The public works department finalized the partnership about a month ago and has been communicating with residents of three neighborhoods in the Mission San Jose district, where it hopes to place turn-restriction signs soon, Veloso said.

Residents from the Canyon Heights neighborhood and the Washington Boulevard and Starr Street areas favor the restrictions, Veloso said, but those in the Mission Highlands neighborhood fear the restrictions would impact them too.

Meanwhile, Veloso said, the city also is close to completing another effort to control traffic congestion. At its Oct. 11 meeting, the Fremont City Council agreed with staff’s recommendation to ask Caltrans to activate the meters at highway on-ramps at Auto Mall Boulevard and Durham Road, Washington Boulevard, and North Mission Boulevard earlier than planned. The meters were installed a couple of years ago by the state agency as part of a larger traffic operating systems project.

According to the city, meters help motorists efficiently merge onto freeways, which should improve traffic flow on 680. At the same time meters increase the time it takes to enter the freeway. Both effects should further discourage motorists from leaving the freeway in the first place.

The city expects congestion to occur around the on-ramps for a short period after the meters are activated as drivers become accustomed to them. Caltrans has not confirmed a date yet, but the city is hoping to have the meters activated by the first week of December.

“There is no perfect solution,” Veloso said. “The perfect solution would be no cut-through traffic at all. But in the absence of the perfect solution, we’re trying this.