  In this paper we explore a solenoid configuration involving a magnetic
universe solution embedded in an empty Anti-de Sitter (AdS) spacetime. This
requires a non-trivial surface current at the interface between the two
spacetimes which can be provided by a charged scalar field. When the interface
is taken to the AdS boundary, we recover the full AdS--Melvin spacetime. The
stability of the AdS--Melvin solution is also studied by computing the
gravitational free energy from the Euclidean action.
