Once a property in Spain is chosen and a price and other conditions of the purchase are agreed by two parties it is possible to go straight to the completion (when all the money necessary for a purchase is already on the Spanish bank account of a buyer) but most buyers/sellers prefer to sign a preliminary sales contract that provides for taking a property off the market. It is a simple agreement in which a seller agrees to sell a property and a buyer agrees to buy a property at the price agreed. This contract will contain all the relevant details such as a description of the property for sale, a purchase price, timescales and date of completion.
At this stage a buyer should pay a deposit that is normally at least 10% of the agreed purchase price.
According to the Spanish legislation if then a seller decides to withdraw a buyer receives a double amount of the deposit as a compensation; if a buyer decides to withdraw he/she will lose the deposit.
Normally it is given a period of time of 3 months after signing this private agreement to complete the final purchase. During this period a buyer can obtain the Foreigner Identification Number (NIE), open a bank account and transfer the money, obtain a mortgage if it is necessary and etc.