There are different narratives about the events during the years 1947-49, but according to the Israeli narrative, the 1948/49 Arab-Israeli War (in Israel called War of Independence) was not initiated or sought by Israel. As the British were about to withdraw from Palestine, the Jewish population of Palestine declared an independent Jewish state on May 14th 1948, one day before the British mandate ended. Israel had agreed upon the suggestion of the UN in 1947 to partition Palestine and give equal parts to the Jews and to the Arabs. Yet, the Arab leaders had rejected the plan to divide the land and responded with heavy violence and the declaration of a holy war against the Jews.
The moment Israel declared her independence, the armies of Egypt, Lebanon, Iraq, Syria and Jordan invaded Israel. Azzam Pasha, the Secretary-General of the Arab League, expressed their goal with the following words: „It will be a war of annihilation. It will be a momentous massacre in history that will be talked about like the massacres of the Mongols or the Crusades.“ 
The United States, the Soviet Union and most of the other countries recognized Israel as an independent state right away and condemned the Arabs for the violence. On June 11, 1948, on demand of the UN Security Council, a truce was enacted. July 9, the Arab armies started to fight again. The Security Council ordered a second truce, which was enacted on the 16th and 17th of July. During these 8 days of fighting Israel took over Nazareth and the Arab villages between Tel Aviv and Haifa. The Israeli army then directed its offensive towards Jerusalem, but could not advance beyond Latrun. The Old City of Jerusalem remained in Arab hands until the end of the second truce, which lasted until the 15th of October 1948.
The summer of 1948 marked a crucial moment in the war – it turned from being defensive to being offensive towards the Arab League. Jews from abroad and foreign volunteer joined and supported the Israeli army, and Israel received additional arms supplies through Czech Republic. Israel dismantled the Egyptian army during the week from October 15th to October 21st in an operation called 10 plagues, later Yoav , by destroying their communication system. The Israeli army succeeded in defeating Egypt along the coast and opening up the road to Jerusalem. Furthermore, Israel seized Beer Sheva and the Sea of Galilee in the North. On October 21st another Ceasefire was announced. Jordan annexed then the eastern part of Jerusalem and the area west of the Jordan river. This annexation was not accepted by the Arab countries, since it took away the independence from the Arabs of Palestine – the Jordanian King Abdullah was later assassinated and killed for this reason during a visit in Jerusalem in 1951. During the last big operation „Horev“, from December 22, 1948, to January 7, 1949, Israel attacked the Egyptian army in the western Negev, overpowered it and won Gaza and parts of the Sinai peninsula, and therefore forced Egypt to withdraw.
Egypt was the first country to sign the armistice agreement with Israel, on the 24th of February in Rhodes. In this agreement, under international pressure, Israel gave back the Sinai and Gaza to Egypt, but kept the Negev. On March 3rd Lebanon signed the armistice agreement, on April 3rd, Jordan, with the agreement that East Jerusalem and the West Bank remained in Jordanian hands. On July 7th Syria signed the armistice and it was agreed upon that the Golan went to Syria. All these agreements were armistices, not peace treaties. This means, the borders were considered as legally temporary. The state of Israel was therefore created with temporary borders.
 see http://www.jewishvirtuallibrary.org/international-recognition-of-israel for a list of the states that recognized Israel and when
 in honor of the senior Palmach officer Yitzhak Dubno, codename ‚Yoav‘, who was killed during the operation