The students in Almeria in southern Spain were caught attempting to cheat an entrance exam for vocational studies when one showed up to take the test pretending to be the other, Europa Press reported on Friday.
Public prosecutors have accused the boys of committing a crime of falsifying public documents because the one that went to the exam had to use the other's ID card and took the test under the other boy's name.
The prosecution is seeking a sentence of one year in prison for each as well as a fine of €6 to be paid each day for 12 months.
One of the students' defense attorney argued that the proposed sentence is "barbaric" and out of proportion with the act, saying that the exam should not be considered as an official document.
"They have not harmed anyone and even though this conduct was reproachable, it does not create social alarm enough to have them sent to prison," attorney José Carlos Segura said.
"That this case is going to trial is already disproportionate and I believe it could be solved with an administrative fine or sanction of academic consequences," he continued. "This kind of punishment threatens them with a loss of liberty and records them permanently as criminals."