“Alaves have finalised the incorporation of Bojan Krkic, a talented and skilled forward with experience in the biggest leagues in the world,” Alaves said in a statement.
Bojan won three La Liga titles and the Champions League twice as a talented youngster at Barcelona.
After spells at Roma, AC Milan and Ajax, he joined Stoke in 2014.
However, he has struggled to hold down a regular starting place under Mark Hughes in recent seasons and also spent the second half of last season on loan at German side Mainz.
His only goal in the Bundesliga against Bayern Munich in April made him only the seventh player to score in the top flight in Spain, England, Italy and Germany.