The state Senate has rejected a bill that would have allowed for an expansion of charter schools in Boston and several other urban communities.

The House-passed bill was rejected on a 30-9 vote Wednesday. Senators had defeated a proposed compromise that would have linked charter school growth to state reimbursements to school districts for their costs when students leave traditional schools for charter schools.

The bill approved by the House in May called for a gradual increase in the existing cap on charter school spending in underperforming school districts until it reached 23 percent in 2022.

Backers of charter schools say they are laboratories for educational innovation, but critics say they drain financial resources from conventional public schools and often provide fewer opportunities for special education students.