The following editorial first appeared in the Kansas City Star:

Critics of the legislative process in Washington often complain about its slow pace. And they are often right.

A good example of the slow-motion style of legislation is the “Allow States and Victims to Fight Online Sex Trafficking Act” that two veteran Missouri lawmakers spearheaded: Democratic Sen. Claire McCaskill and Congresswoman Ann Wagner, a Republican from the St. Louis area.

The desperately needed law was years in the making. It finally gives law enforcement the tools it needs to more easily prosecute websites that facilitate sex trafficking. The bill, which last week passed the Senate 97-2 and is on its way to President Donald Trump, also allows victims to pursue federal civil claims. Trump is expected to sign the bill into law.

Ever since the wildly lucrative world of sex trafficking moved from the streets to the internet, market leaders in commercial sex advertising like Backpage have hidden behind an antiquated section of the Communications Decency Act. The act provided Backpage with what McCaskill called “complete and total immunity from being held accountable for their bad behavior.”

The McCaskill-Wagner legislation ensures that such websites can be held liable. Backpage has annual revenues topping $150 million and has been linked to hundreds of reported cases of sex trafficking.

The law has allowed Backpage “to knowingly facilitate sex trafficking of children online,” McCaskill said when the Senate passed the bill. “But that ends today.”

Wagner, who once was considered a possible challenger to McCaskill in this year’s Senate race, called the legislation transformative because it will discourage businesses from getting involved in sex trafficking.

The law “will produce more prosecutions of bad-actor websites, more convictions, and put more predators behind bars,” Wagner said.

When Backpage refused to turn over documents the Senate sought, McCaskill and Ohio Sen. Rob Portman, a Republican, sought a resolution authorizing a lawsuit against the company. The Senate adopted it 96-0, leading to the first such action in 20 years. Backpage battled all the way to the U.S. Supreme Court before losing.

“We took on a powerful company that stonewalled us at every turn,” McCaskill said.

Under the legislation, local prosecutors can now bring charges against companies like Backpage and attorneys general across the country can file civil claims in federal court.

Wagner’s fight for the new law dates to shortly after her 2012 election to Congress. Over the years, she has spoken frequently on the topic, including to the United Nations. She refers to sex trafficking as “modern-day slavery” and those who traffic in the business as “slave traders.”

After the House vote, she acknowledged that passing the law took awhile. Convincing members of Congress of the scope of the problem took time.

But this fight was worth it.