  It is generally believed that Ultracompact X-ray binaries (UCXBs) evolved
from binaries consisting of a neutron star accreting from a low-mass white
dwarf or helium star where mass transfer is driven by gravitational radiation.
However, the standard white-dwarf evolutionary channel cannot produce the
relatively long-period ($40 - 60$\,min) UCXBs with high time-averaged
mass-transfer rate. In this work, we explore an alternative evolutionary route
toward UCXBs where the companions evolve from intermediate-mass Ap/Bp stars
with an anomalously strong magnetic field ($100 - 10000$\,G). Including the
magnetic braking caused by the coupling between the magnetic field and an
irradiation-driven wind induced by the X-ray flux from the accreting component,
we show that intermediate-mass X-ray binaries (IMXBs) can evolve into UCXBs.
Using the \emph{MESA} code, we have calculated evolutionary sequences for a
large number of IMXBs. The simulated results indicate that, for a small
wind-driving efficiency $f=10^{-5}$, the anomalous magnetic braking can drive
IMXBs to an ultra-short period of 11 min. Comparing our simulated results with
the observed parameters of fifteen identified UCXBs, the anomalous magnetic
braking evolutionary channel can account for the formation of seven and eight
sources with $f=10^{-3}$, and $10^{-5}$, respectively. In particular, a
relatively large value of $f$ can fit three of the long-period, persistent
sources with high mass-transfer rate. Though the proportion of Ap/Bp stars in
intermediate-mass stars is only 5\%, the lifetime of the UCXB phase is
$\gtrsim$ 2 Gyr, producing a relatively high number of observable systems,
making this an alternative evolutionary channel for the formation of UCXBs.
