Paper straws sit on the bar at Fog Harbor Fish House on June 21, 2018 in San Francisco, California. A ban on plastic straws in San Francisco is scheduled to go into effect July 1, 2019. California's statewide law to restrict the use of plastic straws in sit-down restaurants is set to take effect Jan. 1, 2019.

California Gov. Jerry Brown on Thursday signed a bill to reduce ocean waste and the use of plastic straws in the state.

The measure, Assembly Bill 1884, limits restaurants to giving out single-use straws only upon request of customers. It applies to full-service dining establishments but exempts fast-food restaurants.

With the move, California now becomes the first state in the nation to restrict the use of plastic straws in restaurants. Several cities in California, including Malibu and San Francisco, have gone a step further by passing outright bans against the use of plastic straws as well as other single-use items, including plastic utensils.

An attempt to pass a statewide plastic straw ban in Hawaii stalled in a legislative committee this month.

Environmentalists have been fighting to curb plastic waste found in oceans, lakes, rivers and even drinking water. The effort includes campaigns against single-use grocery bags and bottle caps.

Restaurants violating the new California law could be subject to a fine of $25 per day and as much as $300 annually. The measure was approved late last month by the Democratic-backed state legislature despite opposition from some Republican lawmakers who called it a government overreach.

"It is a very small step to make a customer who wants a plastic straw ask for it," Brown said in his signing message for AB 1884. "And it might make them pause and think again about an alternative. But one thing is clear, we must find ways to reduce and eventually eliminate single-use plastic products."

The new law is scheduled to go into effect Jan. 1.

Brown noted that plastic waste causes harm to marine life, including killing millions of animals every year. He cited the case of a dead whale that recently washed up on a beach in Thailand that had some 80 plastic bags in its stomach.

The Democratic governor noted that the plastic waste problem isn't limited to marine life since so-called "microplastics were recently found in tap water around the world. Plastics, in all forms — straws, bottles, packaging, bags, etc. — are choking our planet."

WATCH: How takeout took over America