Conversation so far:
why is portugal a separate country from spain
Portugal started as part of the Spanish kingdom of Leon and became self ruled in the XII century after the Treaty of Zamora.
what did the treaty of zamora do
The Treaty of Zamora (5 October 1143) recognized Portuguese independence from the Kingdom of León.
who was involved in the treaty of zamora
Based on the terms of the accord, King Alfonso VII of León recognized the Kingdom of Portugal in the presence of his cousin King Afonso I of Portugal.

Question: was there a battle before the treaty
Self-contained rewrite: was there a battle before the treaty of zamora