The first step at the border is to head to the police office. They will check your passport and stamp your tourist card.
Then go to the migration building right next door and get your exit stamp.
The last step is to go across the street to the Aduana (note they are closed from 1230 to 130). Here they want your temporary permit. They will enter your info in a ledger and then into the computer. Then they will stamp your portion of the permit and give it back. Donít loose this if you ever want to go to Peru again, since it is proof that you left the country with the bike.