California lawmakers rushed to write a bill to give Amazon.com Inc a one-year reprieve from collecting certain sales taxes in exchange for dropping its ballot measure campaign to undo the tax, aides said on Thursday.

The bill would put in writing the terms of a handshake agreement reached Wednesday between representatives of the Seattle-based Internet retailer, its brick-and-mortar opponents and lawmakers in a meeting called by legislative leaders.

The measure covers the collection of sales taxes on orders through its affiliates in the state.

Top lawmakers called the meeting after Democrats pushing a bill to block Amazon's ballot measure effort --, aimed at the recently enacted sales tax -- concluded they would not be able to win the necessary votes from Republicans for the legislation by Friday, when the legislature's session ends.

Under terms of the deal, Amazon will drop its ballot measure campaign and begin collecting sales tax on orders made by its California shoppers next September if federal legislation on online sales taxes that applies to all states fails to take shape by the end of next July.

A representative of the Amazon campaign was not immediately available to comment on the agreement, which Democrats who control the legislature are likely to support.

They get a little more time and we get this thing resolved, an aide to state Senate President Pro Tem Darrell Steinberg said.

Republicans were waiting to see the agreement's details in print before saying whether they would support it and send the bill to Democratic Governor Jerry Brown, aides said.

Lawmakers may see the legislation by Thursday evening.

Amazon had recently proposed to lawmakers a hiring spree of 7,000 jobs in California if the state put the sales tax on hold for two years.

The offer fell flat with Democrats, who had pressed in state budget talks earlier this year for new revenue to help balance the state's books, which eventually required close a shortfall of $10 billion.

Amazon shares lost 1.2 percent to $217.38 Thursday in Nasdaq.

(Editing by Jeffrey Benkoe)