Critics had called the restoration “lamentable,” and headline writers mocked the project. Hispania Nostra, a preservationist group that advocates the protection of heritage sites, called the new look a “disaster.”

The design drew comparisons to a botched amateur restoration in 2012 of a nearly century-old fresco of Jesus crowned with thorns that has turned into a tourist attraction and economic bonanza for the town of Borja in northeastern Spain.

Matrera Castle, a ninth-century fortress that is privately owned, was declared a national landmark in 1985. The original plans for its restoration were altered after the north wall collapsed in 2013 because of flooding.

Mr. Quevedo Rojas said he submitted his design early this year to Architizer, a social network founded in 2009 that is a kind of Facebook for architects and that hands out awards in a range of categories. Entries were evaluated and shortlisted by 300 experts, with the finalists submitted to an online vote.