A Mexican congressional committee has rejected President Enrique Pena Nieto's proposal to legalize same-sex marriage on a national level.

The measure, which sought to enshrine same-sex couples' right to marry in the constitution, was defeated in a 19-8 vote in the Commission on Constitutional Matters on Wednesday, AP reports.

The outcome means the issue is "totally and definitively concluded," according to a summary posted online by the Chamber of Deputies, which quotes commission chairman Edgar Castillo Martinez.

Pena Nieto submitted the proposal in May, a move which led to large demonstrations both in favor and against gay marriage.

Mexico's Supreme Court ruled last year that it was unconstitutional for states to ban same-sex marriage. However, that decision had no effect of rewriting any laws in the constitution, and left it up to individual state legislatures to change their statutes. As such, same-sex marriages are legal only in some jurisdictions, including Mexico City, the country's capital.