Q: By what year had Portugal established itself as an independent kingdom?
A: By 1139, Portugal had established itself as a kingdom independent from Leon.
Does the answer correctly answer the question
yes