Original: There, they were mistaken for merchants by a royal official.
Simplified: There, a royal official mistook them for merchants.