LONDON — Spain managed to auction €3 billion ($3.8 billion) in medium-term debt Thursday, in the first such sale since EU leaders last week agreed to new measures to help financially weak countries, causing a rally in markets. Demand was good, helping the Treasury sell at the top end of its range of between €2 billion and €3 billion in the auction of three-, four- and 10-year bonds. But investors exacted a price — the interest rate on the sale of €747 million in benchmark 10-year bonds rose to 6.43 percent from 6.04 percent at the last such auction on June 7. The summit last week was perceived as a victory for Spain and Italy because euro leaders agreed to allow the permanent bailout fund to recapitalize troubled banks directly. — AP