In July 1828 a notorious Spanish pirate, Benito de Soto, whose murderous plundering in the south Atlantic had caused considerable concern in Britain, was found to have slipped into the British colony of Gibraltar and taken up residence in a tavern. The discovery considerably embarrassed the governor, Sir George Don, and his military administration. Gibraltar needed external connections by land and sea for daily supplies of food and labour and for trade, but this was a fortress as well as a town, and entry through the gates and rights of residence within the walls were supposedly strictly regulated. The secretary of state for war and the colonies, Sir George Murray, was outraged at this breach of security. He was additionally troubled when it was followed in the autumn of 1828 by another severe outbreak of yellow fever. This too was interpreted as an infection entering from outside and taking hold as a consequence of local administrative negligence. Gibraltar had become insanitary and grossly overcrowded, especially, it was said, with ‘aliens’ who as non-British subjects had no automatic right of residence. Murray's response exemplifies attempts by governments, not only in this period or in colonial spaces, to control the movement and settlement of people by the tight policing of frontiers, the surveillance of residents, and bureaucratic centralised management. He showed his faith in documentary controls by insisting that a Gibraltar passport should be designed, that permits to aliens even for temporary entry should depend upon more searching inquiry and be of strictly limited duration, and that no permit of permanent residence should be issued to an alien without the secretary of state's specific approval. Moreover, responsibility for policing entry into Gibraltar and for surveillance within was taken away from the military and given to a uniformed but civilian police, closely modelled on the Metropolitan Police which Murray's cabinet colleague Robert Peel had just introduced into London. Indeed, James Rowan, put in command of Gibraltar's civilian police force, was the brother of Charles Rowan, one of the first two Metropolian Police Commissioners. However, the powers assigned to James Rowan were the greater since he was also made immediately responsible for carrying out a census to identify not just who was resident in Gibraltar but by what right they were there. This inquiry and the new permit system were particularly intended to flush out the alien, and therefore shared a purpose with the public health regulations which the police magistrate was also required to enforce. However, legislative and policing efforts to exclude the alien ‘other’ still foundered on the capacity of people to evade the law and on the refusal of locally-born British subjects to accept as aliens many of those with whom they shared interests, culture and identity. But none of this concerned Benito de Soto who in January 1830 had been tried in Gibraltar on a charge of piracy, found guilty and executed.