US agrees to pay wrongly detained citizen $400,000